Adds performance benchmarks with tinybench, benchmark CI via CodSpeed#43
Adds performance benchmarks with tinybench, benchmark CI via CodSpeed#43codspeed-hq[bot] wants to merge 9 commits into
Conversation
commit: |
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
| # IMPORTANT! deno task bench fails in CI due to incompatible V8 bindings | ||
| run: node bench/mod.ts |
There was a problem hiding this comment.
The benchmark CI workflow failed with deno task bench because @codspeed/core@5.4.0 ships a native Node.js addon (node.napi.node) that uses V8's C++ API (v8::Isolate::GetCurrent()). Deno uses V8 internally but doesn't export that symbol, so we use node@22 directly here
|
Thanks for the detailed explanation! The approach is correct — using CodSpeed's instrumentation layer ( The workflow configuration looks good:
No changes needed on our side — this is the recommended approach for Deno projects using CodSpeed today. Summary
|
|
Switching to draft until I can debug the Node resolution issue :( Edit: Fixed! Just had to downgrade to tinybench v5 to support the codspeed plugin. |
This PR adds continuous performance benchmarking to clayterm using CodSpeed.
What changed
Benchmark harness -- 18 benchmarks written with tinybench and
@codspeed/tinybench-plugin, organized into three files covering the main performance-sensitive areas of the codebase:bench/ops.bench.ts-- Binary packing of UI operation trees (pack()). Tests simple trees, complex multi-panel layouts, and large 50-item lists.bench/render.bench.ts-- Full WASM-backed render pipeline: Clay layout, cell buffer generation, frame diffing, and ANSI escape output. Includes pointer hit-testing.bench/input.bench.ts-- WASM-backed terminal input parser: ASCII, escape sequences, mouse protocols (SGR/VT200), UTF-8, Kitty keyboard protocol, and multi-event bursts.CI workflow (
.github/workflows/benchmark.yml) -- Runs on pushes tomain, pull requests, andworkflow_dispatch(for CodSpeed backtesting). The pipeline:claysubmoduleclayterm.wasmand the generatedwasm.tsviamakeVerification
All 18 benchmarks were validated locally with the CodSpeed CLI (
codspeed run --mode simulation). Existing tests (140 steps) continue to pass, anddeno fmt --check/deno lintremain clean.Next steps
workflow_dispatchto generate baseline performance data