Benchmark scripts, shared fixtures, and local result artifacts live here. These benchmarks are local diagnostics for Hunk's core promise: fast loading, fast first render, fast navigation, and predictable memory use on large diffs.
Run the default local benchmark suite with one JSON result file:
bun run bench -- --samples 3 --out benchmarks/results/local.jsonRun optional competitor comparisons when the tools are installed:
bun run bench -- --samples 3 --include-competitors --out benchmarks/results/local-with-competitors.jsonRun focused scripts while iterating:
bun run bench:bootstrap-load
bun run bench:working-tree-load
bun run bench:changeset-parse
bun run bench:render-layout
bun run bench:highlight-prefetch
bun run bench:large-stream
bun run bench:large-stream-profile
bun run bench:memory
bun run bench:competitorsbootstrap-load.ts— measures bootstrap and git-loader cost on a synthetic large repo, including file-pair bootstrap.working-tree-load.ts— measures git working-tree loads across small, medium, large, many-untracked, and few-large-untracked repos.changeset-parse.ts— measures patch normalization, Pierre parsing, patch chunking, and normalizedDiffFileconstruction for many-small-files, balanced, and large-single-file patches.render-layout.ts— measures pure split/stack row building, section geometry, and review-plan construction for many-small-files, balanced, and large-single-file streams.highlight-prefetch.ts— measures selected-file highlight startup and adjacent prefetch readiness.large-stream.ts— measures large split-stream first-frame and scroll cost.large-stream-profile.ts— optional local profiler for the main pure planning stages behind the large split-stream benchmark.memory.ts— optional local RSS/heap profiler after fixture loading, planning, first frame, and next-hunk navigation.competitors.ts— optional local informational comparisons againstgit diff --no-ext-diff,delta,difftastic, anddiff-so-fancywhen installed.large-stream-fixture.tsandlib/fixtures.ts— shared deterministic synthetic fixtures.
Each script prints METRIC name=value lines. benchmarks/run.ts repeats scripts, aggregates samples, prints a readable summary, and can write JSON:
{
"version": 1,
"samplesPerBenchmark": 3,
"results": [
{
"name": "large-stream/cold_first_frame_ms",
"unit": "ms",
"samples": [61.2, 60.8, 62.1],
"median": 61.2,
"p75": 62.1,
"p95": 62.1,
"threshold": {
"maxRegressionRatio": 1.15,
"minAbsoluteRegression": 5
},
"comparable": true
}
]
}- These benchmarks are intentionally local-only for now. They are useful diagnostics, but CI proved too noisy and slow for PR gating.
- The default local suite excludes optional memory profiling, pure-planning profiling, and competitor comparisons. Run those focused scripts when deeper diagnostics are needed.
- Competitor comparisons are informational because installed tool versions and feature parity vary by environment.
- Use
--samples 5locally when validating borderline changes. - Use
benchmarks/results/for local benchmark output; result files in that directory are ignored by default.