Repository navigation
perf(miss): single-pass output-meta build in store_rustc_outputs - #650
Merged
Merged
Conversation
Before: four passes over `all_outputs` to compute `artifact_bytes` (sum), `output_names` (Vec<String>), `output_sizes` (Vec<u64>), and `source_paths` (Vec<NormalizedPath>). After: one pass with `with_capacity` hints. Each Vec preallocates its exact final size; iteration is collapsed; `saturating_add` guards the size accumulator. Why micro-opts matter on this path: PR #635 already deferred the artifact persist itself (#632) off the daemon's response-return critical path. What's left between rustc-done and daemon-response is the artifact metadata build, the depgraph update, and the in-memory artifact insert. Every µs shaved off compounds against the same-job-seed warm-MISS gap soldr is chasing in #629 (2-5% behind the no-wrapper baseline on incremental release builds). Trade-off honestly framed: this alone won't close #629. The dominant remaining post-compile chunks are `hash_all_ns` (~64 ms on 4-core CI for a workspace link per #532's comment) and `include_scan`. Those are the next levers. No isolated perf unit test here — the metadata-build phase is sub-µs on 2-output rustc misses and falls below the perf- rust-cluster.yml signal floor. The existing rust-link cold cells in that workflow remain the regression catcher per PERF.md, and the `artifact_meta_build_ns` field on `RustMissProfile` (line 80 of miss_profile.rs) makes any regression directly observable. Refs: #629 Coordinated with zackees/soldr (no soldr-side changes) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Jun 4, 2026
Ships #649 (zccache m e s o n configure wrapper, closes #627), #650 (perf: single-pass output-meta build), #651 (test: cross-key contention), #648 (closes #640). The headline payload is #649 — the wrapper was merged 2026-06-04 but the 1.11.11 release was tagged 2026-06-03, so downstream pyproject pins on >=1.11.11 do not currently see it. This release closes that gap. Validated end-to-end against FastLED on Windows.
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.
Summary
Four-pass over
all_outputsinstore_rustc_outputscollapsed to one. Each output Vec preallocates viawith_capacity, the size accumulator usessaturating_add, and the loop buildsoutput_names/output_sizes/source_paths/artifact_bytesin a single iteration.Why this matters here
PR #635 already deferred the rustc miss persist itself off the daemon's response-return critical path. What remains synchronous between rustc-done and the daemon-response write is the artifact metadata build, the depgraph update, and the in-memory artifact insert.
Every µs shaved off this path compounds against the same-job-seed warm-MISS gap soldr is chasing in #629 (
zccache warm 2-5% behind no-wrapper baseline on incremental release).Honest framing of impact
This alone won't close #629. For 2-output rustc misses (typical:
.rmeta+.rlib) the savings are sub-µs. The dominant remaining post-compile chunks on the critical path are:hash_all_ns(~64ms on 4-core CI for a workspace link per the perf: overlap pre-known input hashing with rustc spawn to cut hash_all_ns on cold workspace links #532 comment)include_scan(dep-info parse)depgraph_updateinsidestore_miss_artifactThose are the next levers. This PR is a compounding micro-opt while the bigger ones get scoped.
Tests
No isolated perf unit test here — the metadata-build phase is sub-µs on typical rustc misses and falls below the perf-rust-cluster.yml signal floor. The existing rust-link cold cells in that workflow remain the regression catcher per PERF.md, and the
artifact_meta_build_nsfield onRustMissProfile(miss_profile.rs:80) makes any regression directly observable in the published phase breakdown.Branch name
perf/linux-asyncpersist-rustcoutput-single-passper PERF.md's scope-table convention. The bench cells exercised here are the linux-x86_64 rust-link cold scenarios.Refs: #629
Coordinated with
zackees/soldr(no soldr-side changes required)🤖 Generated with Claude Code