-
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
Add #[inline] to core debug assertion helpers #113687
Conversation
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
I guess we're not set up to perf test it then, but it makes sense to me! @bors r+ |
📌 Commit 9d4a8e4dc5661125fe3f6b0abde369996d5f0127 has been approved by It is now in the queue for this repository. |
@bors rollup=never |
⌛ Testing commit 9d4a8e4dc5661125fe3f6b0abde369996d5f0127 with merge 88e1282e2e1ca906a8d2c1636b669b0e3dc63cd5... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
9d4a8e4
to
808570d
Compare
808570d
to
65e52bb
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (31395ec): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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: 652.459s -> 650.065s (-0.37%) |
The small number of icount regressions are inconsequential. The large number of binary size reductions are very nice. @rustbot label: +perf-regression-triaged |
I'm shocked this matters at all. Aren't all these functions trivially unreachable and optimized out in a release build of the standard library? I mean, the mir-opt test change suggests that some bits of them remain, which is disconcerting for sure. |
Not sure. I've been complaining a lot about the subideal inlining in libcore for years since this has been a critical problem for folks who want to write embedded code and debug it, too, because the produced binaries without optimisation are so ginormous that they don't even fit in flash. And if they do, they're often running so slow that some strict timing requirements of some hardware can't be fulfilled. And no, embedded developers pretty much never care about debugging libcore on microcontrollers, so it doesn't make sense to generate easily debuggable and super-slow code for trivial operations -- at least not by default as it is now. |
I don't think any of what you have said is relevant to the perf results above. All the perf numbers above are using the precompiled standard library, which has debug assertions disabled. |
These functions are called a lot and not inlined by default in a dev compiler. Adding
#[inline]
should improve things in a dev workflow and be irrelevant in the distributed library.