-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Don't generate a branch hint for assertions in unoptimized builds #117367
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…r=<try> Don't generate a branch hint for assertions in unoptimized builds
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
b80ec77
to
4dda050
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> Don't generate a branch hint for assertions in unoptimized builds
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (61161ce): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 635.323s -> 635.156s (-0.03%) |
Wait, can you share more about the purpose of this PR? Doesn't seem like this has any effect. @rustbot author |
This doesn't have any measurable effect currently. #104862 contains this though, because it was an opportunity I noticed to generate less LLVM IR. I've significantly improved the compile time overhead of that PR (from about 40% to 4% primarily by just reducing the amount of IR that the checks generate, not by generating less checks). I am expecting to eventually have a
So for code like that, I expect that omitting a third of the instructions will have an impact. We just don't generate much code like that yet. And I personally prefer to not land separable optimizations in a PR that is likely to have overhead. The niche checks have overhead, and this PR reduces the overhead of Assert terminators. I'd rather not end up with a perf-neutral PR and people wondering "Where's the compile time overhead of adding all this code? Is it hidden by the improvement of this optimization you did?". |
I'm not certain if I understand this argument. On the flip side, I could say something like I don't understand why we're landing perf-neutral "optimizations" because they affect PRs we plan to land later on. I actually think it makes sense to co-locate regressions with the optimizations that most dramatically affect them. |
I think you understand the argument and just disagree with it :p I'll just keep this change in the originating PR. |
I've been staring a lot at our unoptimized LLVM IR to reduce the perf impact of #104862 and I noticed this. Seems like an easy (if very small) win.