-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web workers #297
Comments
I did some testing with moving some pieces of the Overview
iD uses this code for a lot of things, for example knowing which countries use a VAT ID field, where Aldi Nord vs Aldi Süd operate, and mapping out the Burger King zone of exclusion. These geofences are defined by locationSets and they need to be pieced together soon after iD starts up. Currently, the This work is 1. time consuming and 2. already asynchronous, so that makes it well suited to move into a web worker. ChallengesHere are some things that make web workers hard to work with.
The processHere's what I did:
Some benchmarksThese are interesting because iD first merges the core presets (only 9 locationSets), then fetches the NSI presets (15839 locationSets), then does an unnecessary merge (0 locationSets). So we can see how much different sizes of messages cost. Using postMessageUsing Transferable Object (and very simple TextEncode/TextDecode pack/unpack)TODO: going to try the avro library and see if I can get those main thread unpack times down.. Using Transferable Object (and Avro encoder/decoder)
|
We can move a bunch of our low priority but main-thread-blocking tasks onto web workers for better performance. I'm planning some work on this for the next version.
The text was updated successfully, but these errors were encountered: