Skip to content

Compute the crate hash from encoded metadata in non-incremental builds - #61

Draft
xmakro wants to merge 1 commit into
perf/skip-span-hashing-nonincrfrom
svh-from-metadata
Draft

Compute the crate hash from encoded metadata in non-incremental builds#61
xmakro wants to merge 1 commit into
perf/skip-span-hashing-nonincrfrom
svh-from-metadata

Conversation

@xmakro

@xmakro xmakro commented Jul 27, 2026

Copy link
Copy Markdown
Owner

The crate hash is computed by stable-hashing the HIR. When nothing but the metadata needs it, hash the encoded metadata bytes instead: they are what downstream crates actually read, and they are already being written out.

-1.02% on non-incr full measurements (syn check -2.46%, serde -2.32%, hyper -2.01%, cargo -1.86%), tests/ui 21309 passed / 0 failed.

Prototype: the CrateRoot's own fields are not covered by the hash yet, and only tests/ui has been run. Proc-macro crates keep the HIR hash, since their metadata is a stub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant