-
Notifications
You must be signed in to change notification settings - Fork 23
Add zlib-wasm workload #43
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
Conversation
As a replacement for the asm.js zlib workload in Octane that we removed. Based on public domain zpipe.c example from https://www.zlib.net/zlib_how.html. Compresses about 60KB of Wasm binary, and decompresses again. Built with Emscripten, using zlib Emscripten port. A single iteration takes around 50ms, the total line item around 2s.
|
In #37 (comment) we discussed adding a compression/LZ77-style replacement workload, now that we removed the asm.js Octane zlib workload. Since there is a zlib port for Emscripten, this is actually quite straightforward, so what do you think of this workload? @kmiller68 @eqrion @jandem |
eqrion
left a comment
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.
This LGTM. Clever to re-use the wasm binary as the file to compress.
|
@kmiller68 Rebased and ready to be merged from my side. |
kmiller68
left a comment
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 think you're missing some fcloses, but maybe there's some magic that does it for you? Also, do you know how much time we spend in the fopen emscripten glue? It'd be nice to make sure we don't repeat the async-fs test where all the time is in Math.random.
According to a profile I just took (d8 on x64), we spend ~95.5% of the CPU cycles in Wasm code, ~3% compiling and in the GC, and just <1.5% in JS code, so the Emscripten glue code looks fine to me. |
kmiller68
left a comment
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 too.

As a replacement for the asm.js zlib workload in Octane that we removed.
Based on public domain zpipe.c example from https://www.zlib.net/zlib_how.html.
Compresses a ~60KB Wasm binary, and decompresses it again.
Built with Emscripten, using zlib Emscripten port.
A single iteration takes around 50ms, the total line item around 2s.