-
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
Rewrite precompute_borrows_out_of_scope
for fewer hash table lookups.
#53942
Conversation
It now does one hash table lookup per basic block, instead of one per statement. This is worthwhile because this function is hot for NLL builds of `ucd`.
@bors try |
⌛ Trying commit fb307e5 with merge e6588839b5a4ae34dab4c5c8e5a9b7e49699c3ee... |
☀️ Test successful - status-travis |
@rust-timer build e6588839b5a4ae34dab4c5c8e5a9b7e49699c3ee |
Success: Queued e6588839b5a4ae34dab4c5c8e5a9b7e49699c3ee with parent 8b80390, comparison URL. |
BTW, I verified the correctness of this by implementing the new code alongside the old code, running both in tandem, and asserting that the |
Perf results are in; ucd-check improves by almost 60%. |
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 is nice.
@bors r+ |
📌 Commit fb307e5 has been approved by |
Yay! And it's a 1% NLL win for @nikomatsakis: I have one question. Each BB has |
This is correct, the terminator location is no different from the others from the POV of this code. |
I bet $5 that #53909 will end up landing before this does, in which case this PR will provide (a) a 1% |
well that is an interesting technique to try to get your PR some favoritism from the reviewers! 😉 |
48 hours ago this PR was 10th in Homu's queue. It's now 11th. I find Homu frustrating: #37107 |
…komatsakis Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups. It now does one hash table lookup per basic block, instead of one per statement. This is worthwhile because this function is hot for NLL builds of `ucd`. I haven't measured the effect of this yet because I'm having trouble doing optimized builds of rustc that are suitable for profiling (rust-lang#53916). I will do an online perf run instead. r? @nikomatsakis
Rollup of 11 pull requests Successful merges: - #51366 (stabilize #[panic_handler]) - #53162 (rustdoc: collect trait impls as an early pass) - #53932 ([NLL] Remove base_place) - #53942 (Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups.) - #53973 (Have rust-lldb look for the rust-enabled lldb) - #53981 (Implement initializer() for FileDesc) - #53987 (rustbuild: allow configuring llvm version suffix) - #53993 (rustc_resolve: don't record uniform_paths canaries as reexports.) - #54007 (crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint) - #54040 (update books for next release) - #54050 (Update `petgraph` dependency to 0.4.13 to fix build with nightly) Failed merges: r? @ghost
…komatsakis Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups. It now does one hash table lookup per basic block, instead of one per statement. This is worthwhile because this function is hot for NLL builds of `ucd`. I haven't measured the effect of this yet because I'm having trouble doing optimized builds of rustc that are suitable for profiling (rust-lang#53916). I will do an online perf run instead. r? @nikomatsakis
Rollup of 10 pull requests Successful merges: - #53315 (use `NonZeroU32` in `newtype_index!`macro, change syntax) - #53932 ([NLL] Remove base_place) - #53942 (Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups.) - #53973 (Have rust-lldb look for the rust-enabled lldb) - #53981 (Implement initializer() for FileDesc) - #53987 (rustbuild: allow configuring llvm version suffix) - #53993 (rustc_resolve: don't record uniform_paths canaries as reexports.) - #54007 (crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint) - #54040 (update books for next release) - #54050 (Update `petgraph` dependency to 0.4.13 to fix build with nightly)
It did, by about 4 hours. |
@nnethercote it looks more like yours merged 8h before #53909 (in my timezone of GMT+2: 4PM Sept 8, while 53909 did on Sept 9 at 20 minutes after midnight :) |
It now does one hash table lookup per basic block, instead of one per
statement. This is worthwhile because this function is hot for NLL
builds of
ucd
.I haven't measured the effect of this yet because I'm having trouble doing optimized builds of rustc that are suitable for profiling (#53916). I will do an online perf run instead.
r? @nikomatsakis