Skip to content
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

Add new --parameter-list option for non-numeric parametrized benchmarks #227

Closed
sharkdp opened this issue Oct 13, 2019 · 5 comments · Fixed by #234
Closed

Add new --parameter-list option for non-numeric parametrized benchmarks #227

sharkdp opened this issue Oct 13, 2019 · 5 comments · Fixed by #234

Comments

@sharkdp
Copy link
Owner

sharkdp commented Oct 13, 2019

Add a new option

--parameter-list <VAR> <VALUES>

that can be used like this:

hyperfine \
  --parameter-list branch_name master,feature1,bugfix,my-test-feature \
  --prepare "git checkout {branch_name}; make clean" \
  "make"

This would work just like the --parameter-scan option, but with non-numeric parameter values.

Maybe there is a better name for this command-line option.

see #216

@JuanPotato
Copy link
Contributor

Hi! I'm interested in taking this on if you aren't yet. I feel like --parameter-list is a fine name, --parameter-values could be another option.

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 15, 2019

I'm interested in taking this on if you aren't yet.

Sounds great!

@JuanPotato
Copy link
Contributor

Should parameter-list be able to be used with parameter-scan? Along the same lines, should parameter-list be able to be used twice? That way you could do something like hyperfine --parameter-list filename a,b,c --parameter-list ext csv,json,txt cat {filename}.{ext}

But then the question would be do we combine the two parameter lists in a zip fashion or just all combinations? (a.csv, b.json, c.txt or a.csv, b.csv, c.csv, a.json, b.json, c.json, a.txt, b.txt, c.txt). I think it would be simpler to only allow either list, or scan, but not both.

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 16, 2019

Disallowing --parameter-list and --parameter-scan to be used at the same time sounds fine for me.

Allowing multiple --parameter-list options could be useful, but I think we can skip that for now. If you want to implement it, I'd probably go with the zip-version, not the all-combinations-version. If a user really wants all combinations, they would have to be provided by hand.

@JuanPotato
Copy link
Contributor

For turning the list of parameters into an actual list, master,bugfix,feature1 -> ["master", "bugfix", "feature1"], a split on comma would work but wouldn't allow list items with commas in them. Is there an existing format or tokenizer that is used in hyperfine for this sort of thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants