Uh oh!
There was an error while loading. Please reload this page.
Avoid chain() in find_constraint_paths_between_regions(). - #64801
Conversation
rust-highfive
commented
Sep 26, 2019
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
nnethercote
commented
Sep 26, 2019
@bors try @rust-timer queue |
rust-timer
commented
Sep 26, 2019
Awaiting bors try build completion |
…een_regions, r=<try> Avoid `chain()` in `find_constraint_paths_between_regions()`. This iterator can be hot, and chained iterators are slow. The second half of the chain is almost always empty, so this commit specializes the code to avoid the chained iteration. This change reduces instruction counts for the `wg-grammar` benchmark by up to 1.5%.
bors
commented
Sep 26, 2019
PlasmaPower
commented
Sep 26, 2019
I'd get rid of the is_empty check, and move the code currently in Also, you're currently calling |
bors
commented
Sep 26, 2019
☀️ Try build successful - checks-azure |
rust-timer
commented
Sep 26, 2019
Queued c30cab8 with parent a5bc0f0, future comparison URL. |
Drive by comment, but wouldn't just swapping for constraint in outgoing_edges_from_graph.chain(outgoing_edges_from_picks)for outgoing_edges_from_graph.chain(outgoing_edges_from_picks).for_each(|constraint|achieve the same effect? |
nnethercote
commented
Sep 26, 2019
@matklad: How would that help? |
I'll tag @scottmcm who actually knows this stuff, but my understanding is that I think, in the actual coude, this bottoms out in this fold override. Because of this, |
Uh oh!
There was an error while loading. Please reload this page.
rust-timer
commented
Sep 26, 2019
Finished benchmarking try commit c30cab8, comparison URL. |
estebank
left a comment
There was a problem hiding this comment.
Other than my and @jakubadamw's nitpick, you can consider it an r+ from me.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This iterator can be hot, and chained iterators are slow. The second half of the chain is almost always empty, so this commit changes the code to avoid the chained iteration. This change reduces instruction counts for the `wg-grammar` benchmark by up to 1.5%.
60fa535 to
5ca99b7Comparennethercote
commented
Sep 29, 2019
Thanks for the various comments, I have addressed them all. @estebank, the new code is sufficiently different that you might want to take another look. |
nnethercote
commented
Sep 29, 2019
@matklad: I tried using |
nnethercote
commented
Oct 2, 2019
bors
commented
Oct 2, 2019
📌 Commit 5ca99b7 has been approved by |
…_paths_between_regions, r=estebank Avoid `chain()` in `find_constraint_paths_between_regions()`. This iterator can be hot, and chained iterators are slow. The second half of the chain is almost always empty, so this commit specializes the code to avoid the chained iteration. This change reduces instruction counts for the `wg-grammar` benchmark by up to 1.5%.
Rollup of 11 pull requests Successful merges: - #64649 (Avoid ICE on return outside of fn with literal array) - #64722 (Make all alt builders produce parallel-enabled compilers) - #64801 (Avoid `chain()` in `find_constraint_paths_between_regions()`.) - #64805 (Still more `ObligationForest` improvements.) - #64840 (SelfProfiler API refactoring and part one of event review) - #64885 (use try_fold instead of try_for_each to reduce compile time) - #64942 (Fix clippy warnings) - #64952 (Update cargo.) - #64974 (Fix zebra-striping in generic dataflow visualization) - #64978 (Fully clear `HandlerInner` in `Handler::reset_err_count`) - #64979 (Update books) Failed merges: - #64959 (syntax: improve parameter without type suggestions) r? @ghost
This iterator can be hot, and chained iterators are slow. The second
half of the chain is almost always empty, so this commit specializes the
code to avoid the chained iteration.
This change reduces instruction counts for the
wg-grammarbenchmark byup to 1.5%.