D2ArmorPicker
D2ArmorPicker copied to clipboard
Improve perfomance from workers
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
Double number of workers (6) ~60% better time
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.
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/
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.
Just pushed a merge from upstream to fix conflicts