Skip to content

Commit

Permalink
Auto merge of #119977 - Mark-Simulacrum:defid-cache, r=cjgillot
Browse files Browse the repository at this point in the history
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 rust-lang/rust#45275

[first perf run]: https://perf.rust-lang.org/compare.html?start=30dfb9e046aeb878db04332c74de76e52fb7db10&end=6235575300d8e6e2cc6f449cb9048722ef43f9c7&stat=instructions:u
  • Loading branch information
bors committed Jan 16, 2024
2 parents 2138425 + 7570b55 commit 74ae27d
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 74ae27d

Please sign in to comment.