-
Notifications
You must be signed in to change notification settings - Fork 184
[WIP] feat: add --iterations flags to specify how many times to run target binary #255
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.
Thanks for contributing these changes!
Looks like CI isn't passing yet, so that needs some work.
| # It is not intended for manual editing. | ||
| version = 3 | ||
|
|
||
| [[package]] |
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.
These changes don't belong in this PR, please revert.
| } | ||
|
|
||
| pub fn generate_flamegraph_for_workload(workload: Workload, opts: Options) -> anyhow::Result<()> { | ||
| pub fn generate_flamegraph_for_workload(workload: Workload, opts: Options, iterations: usize) -> anyhow::Result<()> { |
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.
I think it might make sense to store iterations inside Options?
|
|
||
| for _i in 0..iterations { | ||
| if let Workload::ReadPerf(_perf_file) = &workload { | ||
| // pass |
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.
Did you test this with a Workload::ReadPerf scenario? I guess maybe this if needs to be outside this loop, so that we can still pass perf_file to output() (as perf_output)?
|
@djc I am interested in this feature as well, but maybe @bartlomieju got busy in the meantime. Would it be ok if I finished up the PR and got it over the hump? |
|
@dvdplm sounds good to me. Make sure to retain @bartlomieju as a (co-)author of the commits, and probably good to just squash all commits into a single one. |
|
Thanks for picking this up, I completely forgot about this PR. I'm gonna close it for now. |
Hi there! Thanks for the great project, we use it extensively at Deno.
While we are working on improving our startup time, we found out that running the target binary just once is not enough to collect reliable data to see where we're spending time. So I added
--iterationsflag that allows to run target binary multiple times and create a single flamegraph out of all the runs.This is a quick a dirty implementation, but it allows us to collect more detailed data. If there's an interest in adding this flag and upstreaming the patch I'll be happy to clean it up.