-
Notifications
You must be signed in to change notification settings - Fork 14.1k
[Perf experiment] Inline hints on some small, hot functions #137567
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
Conversation
|
r? @spastorino rustbot has assigned @spastorino. Use |
|
Perf run to see if there is any merit to this change: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
[Perf experiment] Inline hints on some small, hot functions During some local profiling, I identified a few tiny hot functions which did not get inlined. From some local perf runs, it looks like adding inline hints to them is beneficial.  I have checked this change both with and without LTO, and I still see a perf difference between the version with and without inline hints. So, this *may* be a good change. However, since I can't run the compiler PGO setup locally, I'll need a perf run to see if this improvement will be seen in the CI build of `rustc`. There is a chance this optimization is already done by PGO(in which case this PR is less useful), but I still want to see if this can have any real effect.
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (dd153da): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.3%, secondary 0.7%)This 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.
CyclesResults (primary -0.2%, secondary -0.2%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 770.447s -> 770.256s (-0.02%) |
Did you benchmark a stage2 build? LTO is ignored for stage1 builds. |
I just used |
During some local profiling, I identified a few tiny hot functions which did not get inlined.
From some local perf runs, it looks like adding inline hints to them is beneficial.
I have checked this change both with and without LTO, and I still see a perf difference between the version with and without inline hints. So, this may be a good change.
However, since I can't run the compiler PGO setup locally, I'll need a perf run to see if this improvement will be seen in the CI build of
rustc.There is a chance this optimization is already done by PGO(in which case this PR is less useful), but I still want to see if this can have any real effect.