Skip to content

benchmark

benchmark #173

Workflow file for this run

name: benchmark
on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '30 23 1 * *'
permissions:
deployments: write
contents: write
jobs:
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-14, macos-15]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install zsh for Ubuntu
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install zsh
- name: Set brew to PATH for Ubuntu
if: runner.os == 'Linux'
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: Initialize zsh
run: zsh ./init.zsh
- name: Benchmark
env:
matrix_os: ${{ matrix.os }}
run: |
hyperfine --show-output --warmup 3 'zsh -i -c exit' -n "zsh load time $matrix_os" --export-json result.json
jq '.results[] | .["name"] = .command | .["unit"] = "millisecond" | .["value"] = (.mean * 1000 | tostring) | [{name, unit, value}]' result.json > bench.json
- name: Store bench
uses: benchmark-action/github-action-benchmark@v1.19.2
with:
tool: "customSmallerIsBetter"
output-file-path: bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
comment-on-alert: true
fail-on-alert: true
alert-threshold: 150%
alert-comment-cc-users: '@rajyan'