-
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
Speed up SVH computation by using Fingerprint::combine(). #47297
Comments
I am taking it. |
Thank you, @srinivasreddy! Let me know if you need any further directions. |
@srinivasreddy are you still working on it or can I take this one? |
Feel free to give it a shot if you are still interested, @Pulkit07! |
Hello @michaelwoerister I would like to take this one, but first I will need a bit more explanation since I'm new to this project. You are suggestings using Fingerprint::combine() method I suppose you meant instead of this .map(|&(def_path_hash, dep_node_index)| {
(def_path_hash, self.dep_graph.fingerprint_of(dep_node_index))
}) create just one fingerprint. There is a commit that is doing what I described, but I'm not sure if it's fine https://github.com/retep007/rust/commit/0c3bf9d82c1dd8c7304ac241bc610efc85ab87fc , particularly if merging vector of hashes to one can't affect something else |
@michaelwoerister did you have time to check my commit? |
Oh, sorry for the delay, @retep007! I remember taking a look and then completely forgot replying to you. The code combining the fingerprints looks good. However, we have to keep the sorting step in order to make the hash more stable. Otherwise exchanging to functions in the source code would lead to a different hash, even though such a change makes no semantic difference. |
…on, r=michaelwoerister Speed up SVH computation by using Fingerprint::combine() Fix rust-lang#47297
Existing fingerprint values can be merged into one fingerprint via the rather efficient
Fingerprint::combine()
method. We should make use of that during SVH computation instead of re-hashing all those fingerprints.See here:
rust/src/librustc/hir/map/collector.rs
Lines 123 to 163 in 2e33c89
The text was updated successfully, but these errors were encountered: