-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Serialize command parameters to data output files #131
Conversation
Thank you very much for your contribution. Can you please provide a little bit of background / motivation for this change? This would make it easier to review. |
197dd64
to
6f2645f
Compare
@sharkdp, thank you for responding, and sorry for the sloppy PR. I have updated the initial comment and the subject. Ultimately this patch is driven by me wanting to directly plot results from JSON output files for parameterized benchmarks (e.g., to inspect scaling behavior and identify breakdown of naive scaling). For that I need direct access to benchmark parameter which currently requires command string parsing or adding values by hand. I also realized that in addition to JSON, CSV output could also benefit from this improvement and updated the patches for that (which actually lead to a simplification). |
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.
Thank you very much for the explanation and for the updates. This looks really great. I have just two minor comments.
src/hyperfine/benchmark.rs
Outdated
@@ -412,5 +412,9 @@ pub fn run_benchmark( | |||
t_min, | |||
t_max, | |||
times_real, | |||
match cmd.get_parameter() { |
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.
Could this match
statement be shortened to something like
cmd.get_parameter().map(|p| p.1)
?
src/hyperfine/types.rs
Outdated
@@ -196,6 +201,7 @@ impl BenchmarkResult { | |||
min, | |||
max, | |||
times: Some(times), | |||
parameter: parameter, |
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 this could just be parameter
instead of parameter: parameter
.
This patch adds any parameter used to data output files (currently JSON and CSV files). With that users have direct access to both input values (i.e., benchmark parameters) and the resulting timings which should simplify follow-up analyses.
6f2645f
to
d29113e
Compare
Thank you for the updates! |
Released in v1.6.0. |
This patch adds any parameter used to data output files (currently JSON
and CSV files). With that users have direct access to both input values
(i.e., benchmark parameters) and the resulting timings which should
simplify follow-up analyses.