[WIP] Fetch and decode buckets in webworker #3068
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Even though, async fetching of data is supposed to not block the main thread, I noticed performance improvements on my setup (speed up factors reaching from 1.3 to above 2.0).
The code in this PR is hacked together as a prototype. If we decide to go with webworkers, we should think about how we want to structure the code so that code duplication is avoided.
My setup was:
The overall time did reduce drastically for me, when the webworker was active (JS execution time itself didn't change very much). Also, the idle time was higher (above 100ms instead of 1 ms).
We should try to reproduce these findings on at least one other system.
In general, using a webworker introduces more complexity (e.g., due to the code isolation). Also it's not clear to me why this perf improvement exists. It would make sense, if the perf speed up was due to the decoding of 4 bit data, but segmentation data is never encoded in 4-bit...
URL of deployed dev instance (used for testing):
Steps to test:
Issues: