Repository navigation
perf(hash): move source names into completed digests - #579
Merged
tinder-maxwellelliott merged 1 commit intoOct 27, 2026
Merged
tinder-maxwellelliott merged 1 commit into
tinder-maxwellelliott merged 1 commit into
Conversation
The source hashing pass is the last consumer of the source records. Consume the vector in parallel so each successful digest takes ownership of its source name and the remaining source fields can drop after use.
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.
The source hashing pass owns the source records and only needs each name and its digest after hashing. Consume the records in parallel, borrow each one to compute its seed and digest, then move the name into the result. This removes a string clone per source and lets each source’s subincludes drop when its hash finishes.
I replayed a synthetic graph with 82,500 source files, 68,000 rules and 9,500 generated files. The source names total 1,897,500 UTF-8 bytes. The unmodified v67.0.1 release and this change produced identical hash and edge files in all seven pairs. The first pair warmed the fixture. The six timed pairs include the slowest candidate run (8.265 s). Differences in median elapsed time, process CPU and peak RSS stayed within the observed variation.
The 192 Rust tests, 21 CLI tests and format check passed with
bazel test --nocache_test_results //src:rust_tests //src:cli_tests //:rust_format_check.Codex for Tamir.
Reproduce the input and compare outputs
Build the optimized generator at each revision with
bazel build -c opt //:bazel-diff. Save the executables asstockandcandidatein a fresh directory. In that directory, save the fixture helper asperf_workload.pyand the program below asfixture.py. Fixture helperThe SHA-256 digests were
902286b4f78b59693f2e5054c6e13c24edecdf21288c5e54255961a499c0802bfor hashes and20694e2d4903d82628a3bf289c5c5ef9b2b00611de41745ee252cf73a0000adffor edges.