-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use LZ4 with WASM for volume saving/undo/redo #6652
Conversation
@@ -8,7 +9,7 @@ import anyTest from "ava"; | |||
import datasetServerObject from "test/fixtures/dataset_server_object"; | |||
import mockRequire from "mock-require"; | |||
import sinon from "sinon"; | |||
mockRequire.stopAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stopAll
s reverted the lz4 mocking (which is necessary since the lz4-wasm module is different for browser and node, unfortunately). it took me a while to figure out that stopAll was the culprit, since it's so inconspicuously in the code. luckily, these statements weren't even necessary.
it's a bit unfortunate that the lz4 mock needs to be at that many places, but I couldn't figure out a better way..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, extremely impressive improvements! 🤯 Thank you for researching and testing 🙏
Unfortunately, I don't get the mocking yet. Why do files that don't have any direct lz4 usages need to import the lz4 mock? - and wouldn't that also import the mock in production? Why not mock only in the test files where it's needed using mockRequire
like we usually do? 🤔
Oh, two non-spec files slipped in there by accident. I corrected these now. |
Hmm, the wasm doesn't load on the dev instance -.- I'm looking into it.. |
@fm3 I think the problem is that the backend serves the |
@daniel-wer please have another look :) now, the deployment at https://lzwasm.webknossos.xyz should work, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with or without my suggestion 👍
During testing of the dev instance, the performance improvement compared to master didn't appear that large. Is that the case for you too? Still, there is an improvement :)
@@ -1,3 +1,4 @@ | |||
import "test/mocks/lz4"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of importing the mock in every test file, I think it should work and would be more foolproof to import it once in frontend/javascripts/test/enzyme/e2e-setup.ts
or do you think the import order could be problematic, then? 🤔
Sorry to comment on the mocking again. It's no big deal if you leave it as-is.
2f5d827
to
c86c647
Compare
…n dev instance" This reverts commit c86c647.
For the record: I measured the performance difference on the dev instance and unfortunately couldn't reproduce the major difference which I observed on localhost before. It seems like the old lz4-js library is way faster (and almost on-par with the wasm library) when being compiled by webpack with production=true. This observation goes a bit against the benchmark cited here, but I assume it can be explained by: (a) too small inputs or (b) the input is "too easy" to compress which is why the wasm library cannot really show its strengths. I think, we should proceed with merging this PR nevertheless, since (a) (de)compression will be much faster on localhost (i.e., during development) and (b) the old library doesn't seem to be really maintained, anymore (e.g., the latest commit is from 2018 but the latest release is from 2016). |
I also bumped the pako library (use for gzip compression when sending save requests) because the version we used dates back to 2015 🙈 The new version is two weeks old. I couldn't see measurable speed improvements, but it shouldn't hurt nonetheless. |
Thank you for re-measuring! I also think we should still proceed with merging this PR 👍 |
…cing * 'master' of github.com:scalableminds/webknossos: (23 commits) Guard against invalid-mag bucket volume save actions (#6660) Add OIDC authentication (#6534) Add second (non-admin) default user to "initial data" trigger (#6666) Fix and improve miscellaneous things in Folders tab (#6674) Improves mag and voxelSize inferral for remote datasets (#6670) Squashed commit of the following: Fix import of N5 datasets by adding n5 schema to frontend validation (#6668) Virtual Folder Structure for Datasets (#6591) Ability to recover from webGL context loss (#6663) Fix assertion that referenced teams cannot be deleted (#6664) fix task summary with pending jobs (#6662) Only allow taskTypeId as parameter in task creation (#6640) Release 22.12.0 (#6661) Create Annotation From View Mode: Keep Activated Mapping (#6647) Workaround to avoid false-positive version warning (#6656) Fix WK-lib download snippet (#6605) Use LZ4 with WASM for volume saving/undo/redo (#6652) Fix version number extraction when building docker image (#6655) Pass mapping name to precompute meshes (#6651) Deduplicate bboxes when importing NML (#6648) ...
See #5970 and #6652 (comment) for context and numbers.
URL of deployed dev instance (used for testing):
Steps to test:
Issues: