-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Group dep node data into a single structure #57061
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors try |
⌛ Trying commit 775d3e0861c93f8e4794264948ba7ed0956d5456 with merge 2f088a6151d06e930ecb997ba0859a9c32fc3b8a... |
☀️ Test successful - status-travis |
@rust-timer build 2f088a6151d06e930ecb997ba0859a9c32fc3b8a |
Success: Queued 2f088a6151d06e930ecb997ba0859a9c32fc3b8a with parent 9689ada, comparison URL. |
Finished benchmarking try commit 2f088a6151d06e930ecb997ba0859a9c32fc3b8a |
Looks like pretty solid wins! I don't have time to review this in detail right now. One thing I noticed: It seems like the PR undoes #49069 which @wesleywiser implemented a while ago per my request. It would be good to check if the wins here are due to the struct-of-arrays approach being a bad idea in this scenario. Maybe it's a bad trade-off, i.e. we trade faster serialization for bad cache locality during tracking. |
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.
Thanks again for the PR, @Zoxc! r=me with the nits addressed.
I'm not quite happy with factoring of functions in the hir collector. It seems that it should be possible to make this a little less complicated. But I couldn't come up with something better either.
src/librustc/hir/map/collector.rs
Outdated
@@ -139,9 +182,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> { | |||
let node_hashes = self | |||
.hir_body_nodes | |||
.iter() | |||
.fold(Fingerprint::ZERO, |fingerprint, &(def_path_hash, dep_node_index)| { | |||
.fold(Fingerprint::ZERO, |fingerprint, &(def_path_hash, hash)| { |
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.
Can you rename fingerprint
to something like combined_fingerprint
and hash
to fingerprint
here? That should make it easier to understand what's going on.
src/librustc/hir/map/collector.rs
Outdated
fn input_dep_node_and_hash<'a, I>( | ||
dep_graph: &DepGraph, | ||
hcx: &mut StableHashingContext<'a>, | ||
def_node: DepNode, |
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.
This should be dep_node
I guess?
src/librustc/dep_graph/graph.rs
Outdated
@@ -211,7 +199,7 @@ impl DepGraph { | |||
reads: SmallVec::new(), | |||
read_set: Default::default(), | |||
})), | |||
|data, key, task| data.borrow_mut().complete_task(key, task)) | |||
|data, key, f, task| data.borrow_mut().complete_task(key, task, f)) |
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.
Can you rename f
to fingerprint
here and at the other occurrences?
src/librustc/hir/map/collector.rs
Outdated
(dep_node_index, hash) | ||
} | ||
|
||
fn hir_dep_nodes<'a, I>( |
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.
Could you please rename this to alloc_hir_dep_nodes
?
@bors r=michaelwoerister |
📌 Commit 2738f2c has been approved by |
@bors r- |
@bors r=michaelwoerister |
📌 Commit 2738f2c has been approved by |
Group dep node data into a single structure r? @michaelwoerister
☀️ Test successful - status-appveyor, status-travis |
r? @michaelwoerister