-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add zstd decompression support #648
Conversation
EDIT: Linked to wrong issue in comment above (now corrected) - I meant #590 "Switch to GitHub Actions instead of Travis". |
@Jaifroid Which zimfarm recipe would you like to have with zstd to secure testing? |
@kelson42 I guess for parity, maybe Ray Charles. Though I still would prefer to do tests as a separate issue because of lack of time right now, and it would delay this PR for quite a long time if it has to be part of this PR. |
@Jaifroid OK, I have put the Ray Charles recipe on Zstd, from October it will make ZIMs in zstd. |
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.
I agree with you that, considering the urgency and the lack of a suitable ZIM file, implementing unit test can be done later in another issue. Could you create it? As we need to keep compatibility with both xz and zstd compressions, I think we should keep the current QUnit and UI test, and simply add some QUnit tests on a zstd file. I don't think #590 has an impact on QUnit tests.
The unused files should be removed from this PR before merging (and some may be moved to another branch) : zstddec.wasm, zstddec_*.js, test ZIM files?
OK, thanks @mossroy. Will do. In view of the fact that Mozilla or other stores may want to see the unminified |
Wasm branch (https://github.com/kiwix/kiwix-js/tree/Test-wasm-version-of-zstandard) and issue (#652) now added and wasm removed from this PR. |
All test files removed except: This should be ready to squash and merge after more testing. I have ported the new code to Kiwix JS Windows to test with UWP and on mobile before merging here. |
Tested, working and stable on:
Both were tested by porting the latest code from Kiwix JS to Kiwix JS Windows and building the UWP app. (Back-end is identical in Kiwix JS Windows.) Everything else I've tested on has been stable and I have not had any corrupted pages. So tomorrow I will squash and merge this, unless anyone else says they want to do more testing. |
I don't think we should keep the unoptimized build of ztddec. |
Ok, will remove. |
Info: Licence = noun; license = verb. US spelling tends to ignore this difference.
I've added the zstandard licences to the licences section of index.html. There was also inconsistency of spelling locally in that area between "Licence" and "License". Strictly, "licence" = noun; "license" = verb (like advice/advise), but US spelling tends to ignore the difference. I haven't attempted to apply this throughout the repo, however, as it would mean multiple changes unrelated to this PR, and it's not very important. I just thought I should explain the changes locally to that file for consistency of what the reader sees in that area. |
Implements #611.
I'm creating this PR for testing, as the code is now working well on two test ZIMs:
wikipedia_bm_all_2020-07.zstd.zim
andfoo-zstd.zim
. Please note that I have not yet compiled zstdec.js with optimizations and minification, but it is very fast even as is.I have tested this on Edge Chromium 85.0, Firefox 80.0, Edge Legacy, and IE11 - all working. I have not tested it on Firefox OS simulator yet, but I have tested on Firefox ESR which is the same codebase as the simulator, and it works in Firefox ESR. It might need to be memory optimized before it will work on lower-powered mobile devices, and at the least the binary should be compiled with -O2 optimizations to make it smaller.
However, I would appreciate any testing at this stage, even while the PR is in draft form. I'll add links to the test ZIMs in a separate post on this PR.
@mossroy I've put you as a reviewer, but don't review the code yet, just do some tests if you have time.