D2ArmorPicker icon indicating copy to clipboard operation
D2ArmorPicker copied to clipboard

Improve perfomance from workers

Open nznaza opened this issue 1 year ago • 2 comments

Since Web Workers copy and serialize (and the main thread deserializes the objects again), reducing the overhead of object creation, transmit, and de/serialization by creating smaller objects from the workers to be transmitted and creating the objects in the main thread offers a performance boost of ~40%, and since the serialization is quicker as well, it has a better # workers scalability.

Same number of workers as beta (3) ~40% better time image

Double number of workers (6) ~60% better time image

This PR does not change the number of workers, it appears to be working well in live with 3, but since it scales good it might be a good idea to add a user selectable number of workers. Changing the batch size (since data is smaller) looks like a good idea but doesn't improve significantly the results.

nznaza avatar Nov 25 '23 00:11 nznaza

Here's a deploy using GitHub pages with 6 workers and the changes, to test them without needing to clone the repo https://nznaza.github.io/D2ArmorPicker/

nznaza avatar Nov 25 '23 05:11 nznaza

Hi, I did not forget this; But I am currently moving to a different apartment and will not have time for this until I have internet there (in a week). Thank you for the contribution and sorry for the delay.

Mijago avatar Nov 29 '23 15:11 Mijago

Just pushed a merge from upstream to fix conflicts

nznaza avatar Apr 21 '24 03:04 nznaza