Comments (8)
Okay, thanks for the clarification. I would like to keep this out for now. I'm happy to discuss this in a separate ticket though, if there is a real use case for this.
from hyperfine.
Another option could be to export an environment variable:
> hyperfine --parameter num_threads 1..8 'make -j $num_threads'
from hyperfine.
This seems like an interesting idea. I personally prefer the first style to the second, but since we'd have to parse apart the input anyway, why not just add --range-min and --range-max values to make it more explicit. For the second example, it may offer some benefit to at least offer a parameter that will set/unset environment variables during runs so that they can be used without users having to remember to manually add and remove them.
from hyperfine.
I personally prefer the first style to the second, but since we'd have to parse apart the input anyway
I think with the second style we would not have to parse the command. We would simply set the environment variable in the current environment and then call the command (via the shell, as usual). Since we spawn a sub-process, the environment variable would be available in the child (the shell and all children further down). This would work in a similar way to:
> export sleep_time=0.2
> hyperfine 'sleep $sleep_time' # note the single quotes.
# $sleep_time is not expanded when we call hyperfine.
why not just add --range-min and --range-max values to make it more explicit.
That sounds reasonable.
For the second example, it may offer some benefit to at least offer a parameter that will set/unset environment variables during runs so that they can be used without users having to remember to manually add and remove them.
I'm not sure I understand.
from hyperfine.
I'm currently working on this...
from hyperfine.
I'm not sure I understand.
I was just thinking that it may be beneficial to offer user's the opportunity to pass in environment variables they want to have set in the child processes we run their applications in. In many cases these could be given as part of the command, but that both makes the original command argument longer and harder for the user to quickly change between runs, and also is not as portable between platforms. On PowerShell, setting environment variables isn't quite as easy as on Linux/macOS where VAR=val <cmd>
will work.
from hyperfine.
I was just thinking that it may be beneficial to offer user's the opportunity to pass in environment variables they want to have set in the child processes we run their applications in.
To be honest, I'm not sure why we should add this to hyperfine. As you said, this will work just fine when done from the shell (because the environment will be inherited by the child processes). Even in PowerShell, it would only be
$env:MyVariable = "SomeValue"
hyperfine ...
from hyperfine.
True, but it offers the ability to test a particular env solely for the command under test, without polluting the user's own environment. It's not a huge thing, more of a creature comfort.
from hyperfine.
Related Issues (20)
- Add quieter markdown `stdout` export HOT 2
- Add short flag counterparts
- Add short flags for `--export` HOT 2
- hyperfine 1.18.0 not published at crates.io HOT 1
- Usage of `hyperfine` to benchmark code HOT 1
- ETA not clearly visible on terminals with a block cursor HOT 1
- run commands only once per set of parameters they use
- Always in this "Initial time measurement" state HOT 6
- Include parameters in output HOT 2
- T
- `-N` makes me can't pass options for command which'll be benchmarked. HOT 1
- Output cpu, disc and memory information HOT 3
- hypperfine without --show-output hard to read on windows7 cmd console HOT 1
- Using --prepare increases benchmark results HOT 2
- Allow custom time measurements HOT 1
- Feature request: Remote commands HOT 1
- Provide Statically Compiled Binaries for (aarch64|arm64) Linux
- Incorrect result for fastfetch HOT 2
- RFE: advanced metrics beyond wall time (CPU time, instruction count, ...)
- Distribution via NPM HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperfine.