1
Fork 0
rust/compiler/rustc_query_system/src
bors 098d4fd74c Auto merge of #119977 - Mark-Simulacrum:defid-cache, r=cjgillot
Cache local DefId-keyed queries without hashing

This caches local DefId-keyed queries using just an IndexVec. This costs ~5% extra max-rss at most but brings significant runtime improvement, up to 13% cycle counts (mean: 4%) on primary benchmarks. It's possible that further tweaks could reduce the memory overhead further but this win seems worth landing despite the increased memory, particularly with regards to eliminating the present set in non-incr or storing it inline (skip list?) with the main data.

We tried applying this scheme to all keys in the [first perf run] but found that it carried a significant memory hit (50%). instructions/cycle counts were also much more mixed, though that may have been due to the lack of the present set optimization (needed for fast iter() calls in incremental scenarios).

Closes https://github.com/rust-lang/rust/issues/45275

[first perf run]: https://perf.rust-lang.org/compare.html?start=30dfb9e046aeb878db04332c74de76e52fb7db10&end=6235575300d8e6e2cc6f449cb9048722ef43f9c7&stat=instructions:u
2024-01-16 21:58:10 +00:00
..
dep_graph Inline 2 functions that appear in dep-graph profiles. 2024-01-14 12:57:13 +00:00
ich Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
query Cache local DefId-keyed queries without hashing 2024-01-15 17:16:45 -05:00
cache.rs Remove a fishy Clone impl 2023-04-04 09:01:44 +00:00
error.rs Stash and cancel cycle errors for auto trait leakage in opaques 2023-10-26 17:58:02 +00:00
lib.rs Rollup merge of #118123 - RalfJung:internal-lib-features, r=compiler-errors 2023-12-05 14:52:41 -05:00
values.rs Value recovery can take the whole CycleError 2024-01-08 20:30:10 +00:00