refactor(@angular/build): use xxhash-wasm for fast non-cryptographic content hashing - #33798
Open
clydin wants to merge 1 commit into
Open
refactor(@angular/build): use xxhash-wasm for fast non-cryptographic content hashing#33798clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a faster, non-cryptographic 64-bit hashing mechanism using xxhash-wasm to replace Node's createHash('sha256') across various build tools, cache keys, and ETags. While this is a great performance improvement, the review highlights critical issues with the synchronous fallback in calculateHashSync, which introduces non-determinism and can break incremental compilation. Additionally, changing calculateGlobalStylesheetConfigHash to an asynchronous function requires updating all of its callers, and ensureXxhash should cache its initialization promise to prevent redundant WebAssembly compilations under high concurrency.
clydin
force-pushed
the
perf/fast-hashing-xxhash
branch
from
August 7, 2026 00:40
ccf4cdc to
ecfc614
Compare
…content hashing Replace OpenSSL SHA-256 with xxhash-wasm for internal non-cryptographic hashing across the build system. This includes JavaScript transformer cache keys, persistent load result disk caches, incremental TypeScript compiler source file versioning, i18n inlining cache keys, stylesheet compilation configuration hashes, and dev server asset ETags. By utilizing a 64-bit non-cryptographic hash backed by WebAssembly, hashing throughput is significantly increased while eliminating V8 OpenSSL C++ context allocations and garbage collection churn during cold and incremental builds.
clydin
force-pushed
the
perf/fast-hashing-xxhash
branch
from
August 7, 2026 00:54
ecfc614 to
9227e43
Compare
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.
Replace OpenSSL SHA-256 with xxhash-wasm for internal non-cryptographic hashing across the build system. This includes JavaScript transformer cache keys, persistent load result disk caches, incremental TypeScript compiler source file versioning, i18n inlining cache keys, stylesheet compilation configuration hashes, and dev server asset ETags. By utilizing a 64-bit non-cryptographic hash backed by WebAssembly, hashing throughput is significantly increased while eliminating V8 OpenSSL C++ context allocations and garbage collection churn during cold and incremental builds.