https://github.com/rwxd/best-of
best-of lets you check the runtime of program executions.
https://github.com/rwxd/best-of
benchmark github runtime
Last synced: 11 months ago
JSON representation
best-of lets you check the runtime of program executions.
- Host: GitHub
- URL: https://github.com/rwxd/best-of
- Owner: rwxd
- License: gpl-3.0
- Created: 2023-08-05T20:02:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-12T16:20:27.000Z (over 2 years ago)
- Last Synced: 2025-02-24T21:16:09.363Z (12 months ago)
- Topics: benchmark, github, runtime
- Language: Go
- Size: 47.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# best-of
`best-of` lets you check the runtime of program executions.
## Installation
Go to the [releases page](https://github.com/rwxd/best-of/releases) and download the latest binary for your system.
Or use `go install`:
```bash
$ go install github.com/rwxd/best-of@latest
```
## Usage
Set the number of executions with the `-n` flag (default 10).
```bash
$ 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.
```bash
$ 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.
```bash
$ 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).
```bash
$ 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.
```bash
$ 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).
```bash
best-of -w 3s -- grep -r "foo" .
```
Show a progress bar with the `--progress` flag.
```bash
$ best-of -q -n 100 --progress -- grep -r "foo" .
[==================================================] 100%
Best: 0.030471 seconds
Worst: 0.033867 seconds
Average: 0.031123 seconds
```