## あるコマンドを10回実行した平均 ```console hyperfile '<コマンド>' ``` `例` ```console $ hyperfine 'bun typecheck' Benchmark 1: bun typecheck Time (mean ± σ): 181.0 ms ± 3.0 ms [User: 541.5 ms, System: 95.1 ms] Range (min … max): 176.0 ms … 185.6 ms 15 runs ``` ## 2つのコマンドの差分を比較 ```console hyperfine '<コマンド1>' '<コマンド2>' ``` `例` ```console $ hyperfine 'bun typecheck:old' 'bun typecheck' Benchmark 1: bun typecheck:old Time (mean ± σ): 805.9 ms ± 8.1 ms [User: 1708.0 ms, System: 111.6 ms] Range (min … max): 794.1 ms … 817.6 ms 10 runs Benchmark 2: bun typecheck Time (mean ± σ): 184.7 ms ± 3.6 ms [User: 552.1 ms, System: 95.4 ms] Range (min … max): 178.0 ms … 190.9 ms 14 runs Summary bun typecheck ran 4.36 ± 0.10 times faster than bun typecheck:old ``` `bun typecheck` の方が『4.36倍程度』速いことが分かる。 ## warmupしてから測定 ```console hyperfine --warmup <回数> '<コマンド>' ``` `例: 3回実行してから測定開始` ```console $ hyperfine --warmup 3 'bun typecheck' ``` ## [[Markdown]]ファイルに測定結果を出力 ```console hyperfine '<コマンド>' --export-markdown <file> ``` `例` ```console hyperfine 'bun typecheck' --export-markdown report.md ``` 結果 (直接記述) | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | | :-------------- | ----------: | -------: | -------: | -------: | | `bun typecheck` | 184.3 ± 5.4 | 176.5 | 198.8 | 1.00 |