-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document and improve (a lot) lintcheck --perf #14194
base: master
Are you sure you want to change the base?
Conversation
Introducing a new chapter to the book, known as "Benchmarking Clippy". It explains the benchmarking capabilities of lintcheck --perf and gives a concrete example on how benchmark and compare a PR with master
- Now lintcheck perf deletes target directory after benchmarking, benchmarking with a cache isn't very useful or telling of any precise outcome. - Support for benchmarking several times without having to do a cargo clean. Now we can benchmark a PR and master (or a single change in the same commit) without having to move the perf.data files into an external directory. - Compress perf.data to allow for allowing multiple stacks and occupy much less space
Maybe we should integrate this into the CI as well. If this is costly (I haven't had a chance to try it yet), we may even be able to watch the comments and react to certain commands, as we would do with a bot. |
r? @Alexendoo I won't get to review this any time soon. And I think, Alex is the better reviewer for this anyway. |
|
||
The first `perf.data` will not have any numbers appended, but any subsequent | ||
benchmark will be written to `perf.data.number` with a number growing for 0. | ||
All benchmarks are compressed so that you can |
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.
Looks like the end of this sentence is missing! :)
cmd.args(&[ | ||
"record", | ||
"-e", | ||
"instructions", // Only count instructions | ||
"-g", // Enable call-graph, useful for flamegraphs and produces richer reports | ||
"--quiet", // Do not tamper with lintcheck's normal output | ||
"--compression-level=22", |
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.
Does this not slow down the capture? zstd 22 is pretty slow
cmd.args(&[ | ||
"record", | ||
"-e", | ||
"instructions", // Only count instructions | ||
"-g", // Enable call-graph, useful for flamegraphs and produces richer reports | ||
"--quiet", // Do not tamper with lintcheck's normal output | ||
"--compression-level=22", | ||
"--freq=97", // Slow down program to capture all events |
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 reduces the sampling frequency considerably meaning fewer captured events
There is no way to capture all the events with perf record
as it is a sampling profiler
In #14116 we added a benchmarking option for Lintcheck, this commit adds a new chapter to the book AND improves that option into a more usable state.
It's recommended to review one commit at a time.
Document how to benchmark with lintcheck --perf
Several improvements on lintcheck perf (desc.)
Now lintcheck perf deletes target directory after benchmarking,
benchmarking with a cache isn't very useful or telling of any
precise outcome.
Support for benchmarking several times without having to do
a cargo clean.
Compress perf.data
changelog: none