Runs Hyperfine as a github action
Inspired by the Denoland benchmark suite
Create a .hyperfine.js
module.exports = [{
name: 'Sleep 100ms',
command: 'sleep 0.1'
}, {
name: 'Test index',
command: 'node index.js'
}]Add the action to your github action
- uses: blacha/hyperfine-action@releases/v1output
Run blacha/hyperfine-action@releases/v1
Starting benchmark Sleep 100ms
Benchmark #1: sleep 0.1
Time (mean ± σ): 101.2 ms ± 0.1 ms [User: 1.0 ms, System: 0.3 ms]
Range (min … max): 101.0 ms … 101.4 ms 29 runs
Starting benchmark Test index
Benchmark #1: node index.js
Time (mean ± σ): 5.039 s ± 0.002 s [User: 28.8 ms, System: 6.7 ms]
Range (min … max): 5.035 s … 5.043 s 10 runs
Example Repo Actions
In the future the benchmarks.json could be parsed and pushed to github pages to create a dynamic benchmark generation