2026-10-02 11:45:20 +02:00
|
|
|
This folder contains scripts that can be used in combination with hyperfine's `--export-json` option.
|
2018-12-12 20:30:19 +01:00
|
|
|
|
|
|
|
|
### Example:
|
|
|
|
|
|
2022-05-19 17:54:31 -06:00
|
|
|
```bash
|
|
|
|
|
hyperfine 'sleep 0.020' 'sleep 0.021' 'sleep 0.022' --export-json sleep.json
|
2026-10-02 11:55:37 +02:00
|
|
|
uv run plot_whisker.py sleep.json
|
2018-12-12 20:30:19 +01:00
|
|
|
```
|
2019-10-06 21:29:37 +02:00
|
|
|
|
2026-10-06 15:50:19 +02:00
|
|
|
All plotting and analysis scripts use the JSON export's `primary_metric` by default.
|
2026-10-06 09:09:18 +02:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
uv run plot_histogram.py benchmark.json --metric instructions
|
|
|
|
|
```
|
|
|
|
|
|
2026-10-02 11:45:20 +02:00
|
|
|
### Prerequisites
|
2019-10-06 21:29:37 +02:00
|
|
|
|
2026-10-02 11:55:37 +02:00
|
|
|
Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/) and run the
|
|
|
|
|
commands above from this directory.
|
2024-08-28 17:25:05 +02:00
|
|
|
|
2026-10-02 11:55:37 +02:00
|
|
|
The scripts declare their dependencies using [PEP 723](https://peps.python.org/pep-0723/)
|
|
|
|
|
inline script metadata. `uv run` automatically installs these dependencies in an
|
|
|
|
|
isolated environment before running the script.
|