Skip to content

Caching the stable hash of Ty within itself#94299

Merged
bors merged 4 commits intorust-lang:masterfrom
oli-obk:stable_hash_ty
Mar 1, 2022
Merged

Caching the stable hash of Ty within itself#94299
bors merged 4 commits intorust-lang:masterfrom
oli-obk:stable_hash_ty

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Feb 23, 2022

Instead of computing stable hashes on types as needed, we compute it during interning.

This way we can, when a hash is requested, just hash that hash, which is significantly faster than traversing the type itself.

We only do this for incremental for now, as incremental is the only frequent user of stable hashing.

As a next step we can try out

  • moving the hash and TypeFlags to Interner, so projections and regions get the same benefit (tho regions are not nested, so maybe that's not a good idea? Would be nice for dedup tho)
  • start comparing types via their stable hash instead of their address?

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

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants