Comments (4)
Thank you for the feedback.
Is it possible to split-up your script into two parts (generate-keys.sh
, benchmark.sh
)? In this case, you can use the --prepare
option of hyperfine
:
> hyperfine --prepare ./generate-keys.sh ./benchmark.sh
from hyperfine.
I thought about that, yes, but I'd still measure the time required to read the keys from disk then. I'm running benchmarks for 1, 10, 100, 100 keys and 1, 10, 100, 1000 messages currently and simply subtract the time required for 1 messages from the final value, which gets me just the time required for 999 message validations without the setup phase.
from hyperfine.
I see. Making the setup phase negligible by increasing the number of iterations is certainly a good idea if you are only interested in the time for a single iteration.
However, I'm afraid that hyperfine
is not really the best tool for your use case. It is really about quick, whole-program benchmarks. If you need finer granularity, I think you would be better off by using a benchmarking library from the programming language that you write your script in (or is it a shell script? 😄).
Waiting for a magic string value in the output of the benchmarked program doesn't really sound like a very natural extension for me, to be honest. However, if you have any other ideas on how to make this work, I'm certainly open to hearing about them!
from hyperfine.
Closing this for now. Happy to re-open this, if there is more to discuss.
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 2
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.