Conversation
Overall package sizeSelf size: 30.12 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------|🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BridgeAR
approved these changes
May 28, 2025
Member
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM. I am not super fond of introducing 300kb for it but I guess memory is still less important in most cases.
szegedi
added a commit
that referenced
this pull request
Jun 3, 2025
* Handle wasm-pack's dash-to-underscore filename transformation * Add a crate for wasm zstd implementation * Only run tests for a single crate * Fix WASM builds on macOS
Merged
szegedi
added a commit
that referenced
this pull request
Jun 3, 2025
* Handle wasm-pack's dash-to-underscore filename transformation * Add a crate for wasm zstd implementation * Only run tests for a single crate * Fix WASM builds on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Exposes the Rust zstd compression implementation, the same one used by libdatadog profiler, compiled to WASM. This is primarily meant to be used by Node.js profiler to compress profiles with zstd on Node.js versions earlier than 23.8.0, when zstd support was introduced. This implementation is somewhat inferior to the built-in one in the sense that it is synchronous, but if that proves to be a problem we can spin off a worker thread for it.
libdatadog is soon shipping a version that can use zstd as a compression algorithm. We could've relied on its profiling crate and I could've asked for an API endpoint, basically "here, compress this byte array". But then we'd have to ship the libdatadog profiler crate as a dependency. It seemed much simpler to bind directly to zstd_rs even though it's not a libdatadog binding. It does serve us to get at feature parity with libdatadog though. The generated WASM component clocks at 310kB.
The PR also fixes minor issues that cropped up with there now being more than one WASM component in the repo. Big thanks to @BaptisteFoy for blazing the trail of adding support for WASM crates in the first place!
One known problem is that clang on macOS seems to have trouble compiling zstd to wasm unless
brew install llvmis used. However, when Homebrew llvm is used then a different issue crops up. I eventually managed to work around all of that in a build script so local development work isn't blocked on macOS. (The project builds correctly without any modification on Linux, where we release.)Jira: PROF-11878