hyperfine icon indicating copy to clipboard operation
hyperfine copied to clipboard

Run commands sequentialy instead of in groups.

Open AskSkivdal opened this issue 8 months ago • 3 comments

Is there a way to make the commands execute sequentially?

Why would this be useful?

This would be useful if the steps are dependent on each other. This could also allow the user to get more specificity into the precise timings of each piece of their code. My current use case for this is that i need to benchmark a couple of python scripts that run sequentially as part of a data pipeline to find the ones that waste the most time so i can rewrite them.

How i think this should be solved

I want a flag that lets you run the commands in a sequence instead of running the same commands multiple times.

Example

Running

hyperfine --run-sequentially './command1.sh' './command2.sh'

should run it in this order

./command1.sh
./command2.sh

./command1.sh
./command2.sh

./command1.sh
./command2.sh

instead of

./command1.sh
./command1.sh
./command1.sh

./command2.sh
./command2.sh
./command2.sh

AskSkivdal avatar Aug 05 '25 07:08 AskSkivdal

You can achieve this behavior manually although. You can use:

hyperfine "./command1.sh && ./command2"

Try this for example to see the output:

hyperfine --show-output -r 3 "echo 'command 1' && echo 'command 2' ; sleep 1"

christ4k avatar Oct 27 '25 06:10 christ4k

if i run

hyperfine "./command1.sh && ./command2"

I will just get the total runtime, i would like to be able to see the runtime for each of the scripts

AskSkivdal avatar Oct 31 '25 06:10 AskSkivdal

OK you're right. If you want separate times, then there must be a feature to run sequentially your scripts.

christ4k avatar Oct 31 '25 06:10 christ4k