-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incr.comp.: Store DepNode colors in a dense array instead of a hashmap. #48206
Conversation
@bors try |
⌛ Trying commit d4b8475 with merge b9b23ff5e8fb80c09f74cc608d96763149daecfa... |
☀️ Test successful - status-travis |
@Mark-Simulacrum Could you start a perf-run, please? |
Queued. |
fn insert(&mut self, index: SerializedDepNodeIndex, color: DepNodeColor) { | ||
self.values[index] = match color { | ||
DepNodeColor::Red => COMPRESSED_RED, | ||
DepNodeColor::Green(index) => index.0 + COMPRESSED_FIRST_GREEN, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're storing this at the index anyway, do we need to store the index value in it? Seems like perhaps no, in which case we could fairly easily optimize the IndexVec
to have u8
values instead of `u32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought but it's a different index. We address into the array by SerializedDepNodeIndex
(that is the index the node had in the depgraph from the previous session) and what we store is the current DepNodeIndex
, which is the index the node has in the depgraph currently being built.
Looks like a mild improvement (a few percent) in some cases; no regressions. |
@bors r+ |
📌 Commit d4b8475 has been approved by |
Cool, that's pretty much the best that I expected |
…komatsakis incr.comp.: Store DepNode colors in a dense array instead of a hashmap. Implements half of rust-lang#47293. r? @nikomatsakis
…komatsakis Fixes rust-lang#47311. r? @nrc
…komatsakis incr.comp.: Store DepNode colors in a dense array instead of a hashmap. Implements half of rust-lang#47293. r? @nikomatsakis
…komatsakis incr.comp.: Store DepNode colors in a dense array instead of a hashmap. Implements half of rust-lang#47293. r? @nikomatsakis
Implements half of #47293.
r? @nikomatsakis