Optimize try_mark_green and eliminate the lock on dep node colors#57065
Optimize try_mark_green and eliminate the lock on dep node colors#57065bors merged 2 commits intorust-lang:masterfrom
Conversation
|
@bors try |
|
⌛ Trying commit 84aa34d621f10826957bb64c08699307a3f69fc3 with merge 2897f68c5b419b38ac5e1a32910abe9112ea8a3c... |
|
☀️ Test successful - status-travis |
|
Nice @rust-timer build 2897f68c5b419b38ac5e1a32910abe9112ea8a3c |
|
@rust-timer build 2897f68c5b419b38ac5e1a32910abe9112ea8a3c |
|
Success: Queued 2897f68c5b419b38ac5e1a32910abe9112ea8a3c with parent fa922ab, comparison URL. |
|
Finished benchmarking try commit 2897f68c5b419b38ac5e1a32910abe9112ea8a3c |
|
This is another case where measuring with parallel queries would be useful... |
|
@michaelwoerister Benchmarks on x86 won't be useful, since the atomic operations lowers to regular load/stores, so this literally just removes the lock on dep node colors. |
|
I know but that lock can only be really expensive with parallel queries because of contention, right? |
|
☔ The latest upstream changes (presumably #57607) made this pull request unmergeable. Please resolve the merge conflicts. |
michaelwoerister
left a comment
There was a problem hiding this comment.
It would have been nice to have a performance comparison for the multi-threaded case but that's complicated and not really worth the effort. The changes already show a small win in single-threaded mode and it can only improve the situation with parallel queries, so let's go ahead and merge.
r=me with the nits addressed.
Great work, @Zoxc!
src/librustc/dep_graph/graph.rs
Outdated
There was a problem hiding this comment.
Could you add a doc comment here? Something like "Try to mark a dep-node green for which we already know that it existed in the previous compilation session".
src/librustc/dep_graph/graph.rs
Outdated
There was a problem hiding this comment.
We already do the debug assertion a few lines above. You can just remove this one (and move the comment up).
src/librustc/dep_graph/graph.rs
Outdated
There was a problem hiding this comment.
Could you move this comment into the None branch of the match below?
|
@bors r=michaelwoerister |
|
📌 Commit 1313678 has been approved by |
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on rust-lang#56614 r? @michaelwoerister
Rollup of 6 pull requests Successful merges: - #56884 (rustdoc: overhaul code block lexing errors) - #57065 (Optimize try_mark_green and eliminate the lock on dep node colors) - #57107 (Add a regression test for mutating a non-mut #[thread_local]) - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356)) - #57551 (resolve: Add a test for issue #57539) - #57598 (Add missing unpretty option help message) Failed merges: r? @ghost
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on rust-lang#56614 r? @michaelwoerister
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on rust-lang#56614 r? @michaelwoerister
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on rust-lang#56614 r? @michaelwoerister
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on #56614 r? @michaelwoerister
|
☀️ Test successful - checks-travis, status-appveyor |
Blocked on #56614
r? @michaelwoerister