Skip to content

rwxd/best-of

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

best-of

best-of lets you check the runtime of program executions.

Installation

Go to the releases page and download the latest binary for your system.

Or use go install:

go install github.com/rwxd/best-of@latest

NixOS / Nix

Refer to https://github.com/rwxd/my-nixpkgs for the nix package.

Usage

Set the number of executions with the -n flag (default 10).

$ best-of -n 3 -- grep -r "foo" .
Best: 0.031332 seconds
Worst: 0.031558 seconds
Average: 0.031477 seconds

Change the output format with the -o flag.

$ best-of -o ms -- grep -r "foo" .
Best: 31.308470 milliseconds
Worst: 31.962246 milliseconds
Average: 31.662080 milliseconds

Quiet the output of the programs with the -q flag.

$ best-of -q -- grep -r "foo" .
Best: 0.030725 seconds
Worst: 0.031578 seconds
Average: 0.031138 seconds

Use concurrent executions with the -c flag (default 1).

$ best-of -c 10 -- grep -r "foo" .
Best: 0.030725 seconds
Worst: 0.031578 seconds
Average: 0.031138 seconds

Get percentiles with the -p flag.

$ best-of -p -q -n 500 -- grep -r "foo" .
Best: 0.030763 seconds
Worst: 0.034639 seconds
Average: 0.031361 seconds
Median: 0.031313 seconds
90th percentile: 0.031742 seconds
95th percentile: 0.031873 seconds
99th percentile: 0.032652 seconds

Wait between runs with the -w flag (default 0).

best-of -w 3s -- grep -r "foo" .

Show a progress bar with the --progress flag.

$ best-of -q -n 100 --progress -- grep -r "foo" .
[==================================================] 100%
Best: 0.030471 seconds
Worst: 0.033867 seconds
Average: 0.031123 seconds

About

best-of lets you check the runtime of program executions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages