-
Notifications
You must be signed in to change notification settings - Fork 36
add a page on optimizations and profiling #45
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
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.
This is fantastic, thank you so much!! I wouldn't have thought of half of these ideas :)
src/development/perf-benchmarking.md
Outdated
e.g. to run it under `perf stat` or cachegrind. | ||
|
||
Build and link the [stage1](https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#creating-a-rustup-toolchain) | ||
compiler as rustup toolchain and then use that to build the standalone benchmark with a modified standard library. |
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.
Thanks for linking this! I want to reland that PR but haven't had time.
* [disable ASLR](https://man7.org/linux/man-pages/man8/setarch.8.html) | ||
* [pinning](https://man7.org/linux/man-pages/man1/taskset.1.html) the benchmark process to a specific core | ||
* [disable clock boosts](https://wiki.archlinux.org/title/CPU_frequency_scaling#Configuring_frequency_boosting), | ||
especially on thermal-limited systems such as laptops |
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.
We can also add a link to something like https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/docs/src/linuxtips.md.
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.
Some of those things may not be relevant to std benchmarks, which are mostly are CPU- or memory-bandwidth-bound and single-threaded. They shouldn't suffer much from swap, IRQs or SMT-siblibgs if you ensured the system is mostly idle since they depend on system activity (well, depends on how many cores one has... maybe core isolation is still worth it).
Scheduling and throttling have the biggest impact in my experience. If we had a benchmark that tried to do a parallel sort on a huge dataset that would be a different story.
Adjusting the scaling governor is a good point.
- mention scaling governors - linking stage0 as rustup toolchain is now supported
Thank you! |
generated from commit b61d0a2
@jyn514 requested a guide how to benchmark std changes.