-
-
Notifications
You must be signed in to change notification settings - Fork 12
Bump zstd 1.5.0 #26
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
base: main
Are you sure you want to change the base?
Bump zstd 1.5.0 #26
Changes from all commits
4e0d68e
e4d20d4
cc38c82
af14568
c5d2b81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,25 @@ npm test | |
|
||
## Building from source | ||
|
||
Compiled from https://github.com/facebook/zstd/tree/dev/contrib/single_file_libs, with the | ||
Compiled from https://github.com/facebook/zstd/tree/dev/build/single_file_libs, with the | ||
following steps: | ||
|
||
```shell | ||
./combine.sh -r ../../lib -o zstddeclib.c zstddeclib-in.c | ||
emcc zstddeclib.c -Oz -s EXPORTED_FUNCTIONS="['_ZSTD_decompress', '_ZSTD_findDecompressedSize', '_ZSTD_isError', '_malloc', '_free']" -s ALLOW_MEMORY_GROWTH=1 -s MALLOC=emmalloc -o zstddec.wasm | ||
base64 zstddec.wasm > zstddec.txt | ||
./create_single_file_decoder.sh | ||
``` | ||
|
||
> **Note** | ||
The current build is based on zstd v1.5.0. The binary sized increased | ||
following this version. | ||
|
||
```shell | ||
emcc zstddeclib.c -s EXPORTED_FUNCTIONS="['_ZSTD_decompress', '_ZSTD_findDecompressedSize', '_ZSTD_isError', '_malloc', '_free']" -Wl,--no-entry -s WASM=1 -Oz -g0 -flto -s ALLOW_MEMORY_GROWTH=1 -s FILESYSTEM=0 -s STANDALONE_WASM=1 -DNDEBUG=1 -s PURE_WASI=0 -o zstddec.wasm | ||
base64 -w 0 zstddec.wasm > zstddec.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, the size of the build is roughly doubled after the update. Any idea what might be the cause of that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, not sure why that is case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid this may be a blocker -- I don't know if I can justify updating the dependency with that size difference. Many users of the package are sensitive to bundle size. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed improved flags and also backed down on the version. Here is what I found:
|
||
``` | ||
|
||
> **Note** | ||
The `-w 0` argument is only for the `base64` shipped on Linux systems -- on macOS this should be omitted. | ||
|
||
The base64 string written to `zstddec.txt` is embedded as the `wasm` variable at the bottom | ||
of the source file. The rest of the file is written by hand, in order to avoid an additional JS | ||
wrapper generated by Emscripten. | ||
|
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.
What is the
-w 0
flag? I don't have that option (macOS Ventura), maybe we have different versions of this utility?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.
On Linux it prevents newline's
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 added a note on this in the README.