-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
perf: Reuse a Vec in mir simplification #68551
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
perf: Reuse a Vec in mir simplification Just moves the vec out of the outer loop so it is reused every iteration
@@ -124,7 +124,7 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> { | |||
} | |||
|
|||
let data = &mut self.basic_blocks[bb]; | |||
data.statements.extend(new_stmts); | |||
data.statements.extend(new_stmts.drain(..)); |
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.
I feel like maybe merge_successor
count take bb
and modify self.basic_blocks[bb].statements
, draining from the original block directly, without any of these copies into a buffer? But that's neither here nor there.
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.
Fixed, I thought that would be more difficult since there is a risk that the side effect of appending affects something else. Was pretty trivial though when I actually looked at it.
☀️ Try build successful - checks-azure |
Queued 874bb3e with parent 3d8778d, future comparison URL. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Er... @rust-timer build 874bb3e |
Queued 874bb3e with parent 3d8778d, future comparison URL. |
Perf looks like noise, maybe a slight regression. Might be because there is no specialization on |
@Marwes Why not use |
d15a71f
to
3aea9a5
Compare
👍 Wasn't aware that it existed, thanks! |
Could use another part run with the improvements |
@bors try |
Awaiting bors try build completion |
⌛ Trying commit 3aea9a50f2d262384720050b4a9c1951723f65ff with merge 838480bdac784cac159fd709268227e4f762ef11... |
☀️ Try build successful - checks-azure |
Queued 838480bdac784cac159fd709268227e4f762ef11 with parent 1f8df25, future comparison URL. |
Finished benchmarking try commit 838480bdac784cac159fd709268227e4f762ef11, comparison URL. |
⌛ Testing commit 851e9d6 with merge d867495cc949f2e30f09e34fce5ef2f929ac4b28... |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. 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 |
💔 Test failed - checks-azure |
Seems spurious. @bors retry |
perf: Reuse a Vec in mir simplification Just moves the vec out of the outer loop so it is reused every iteration
💥 Test timed out |
No reason this should time out, so I'll give it one more try. Is this appropriate @pietroalbini? @bors retry |
Since this is explicitly called out as perf-relevant... @bors rollup=never |
⌛ Testing commit 851e9d6 with merge 8780469d4997fb4ac0b4f0741f28200e83196cbd... |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. 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 |
💔 Test failed - checks-azure |
☀️ Test successful - checks-azure |
Just moves the vec out of the outer loop so it is reused every iteration