Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Benchmark

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

env:
MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,pnpm

jobs:
benchmarks:
name: Run benchmarks (walltime, memory)
runs-on: codspeed-macro-arm64-graviton-ubuntu-22-04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
- run: pnpm install --frozen-lockfile
- name: Run benchmarks with CodSpeed
uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5
with:
mode: walltime,memory
run: pnpm bench
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,26 @@
"scripts": {
"dev": "bsh dev",
"build": "pnpm --filter \"@clack/*\" run build",
"bench": "pnpm -r --workspace-concurrency=1 --if-present bench",
"format": "bsh format",
"format:check": "bsh format --check",
"lint": "bsh lint .",
"test": "bsh test"
},
"devDependencies": {
"@bomb.sh/tools": "^0.8.0",
"@codspeed/vitest-plugin": "6.1.0",
"@termless/core": "^0.10.2",
"@termless/test": "^0.10.2",
"@types/node": "^22.20.0",
"node-pty": "1.2.0-beta.15"
"node-pty": "1.2.0-beta.15",
"vitest": "5.0.5"
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "10.7.0",
"onFail": "error"
"onFail": "warn"
},
"runtime": {
"name": "node",
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
Run the full Vitest `createUI` frame benchmark matrix with:

```sh
pnpm --filter @clack/ui bench
pnpm bench
```

The same command runs in CodSpeed on pushes to `main` and pull requests. CI uses
walltime for elapsed time, including async frame output, then runs the benchmarks
again with memory tracking to report allocations and peak memory.

`createUI()` and fixture construction are outside the timed
sample. The initial-render comparison measures starting `ui.main()` through its first
output callback. Each update workload compares six tree shapes at 100, 500, 1,000, and
Expand Down
Loading
Loading