Repository navigation
ci: add first-frame and scroll benchmarks to the PR bench job - #56
Merged
Merged
Conversation
The bench job only gated --render startup. Add first-frame mount and per-step scroll latency, the metrics the recent progressive-mount work moved, so regressions in either fail the PR bench. - first-frame.tsx / scroll.tsx: emit machine-readable JSON (--json), and --runs N on first-frame aggregates fresh subprocess samples to a p50. - bench-compare.ts: add compareMetrics/renderMetricTable + a --metrics CLI mode that diffs two harness JSON payloads and gates on the same warn/fail ratios; --append stacks tables into one summary. - main.yml: generate large.md, copy the PR harness into the baseline worktree so both builds run identical measurement code against different src, then compare and post all three tables.
Startup benchmark (
|
| build | mean | ratio | verdict |
|---|---|---|---|
| baseline (main@3b6d9f2) | 380.7ms ± 7.1ms | — | |
| PR | 386.6ms ± 10.8ms | 1.02× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
First-frame (large.md, runs=10)
| metric | baseline (main@3b6d9f2) | PR | ratio | verdict |
|---|---|---|---|---|
| first-frame | 290.6ms | 299.4ms | 1.03× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
Scroll (large.md)
| metric | baseline (main@3b6d9f2) | PR | ratio | verdict |
|---|---|---|---|---|
| full_mount | 12256.0ms | 13035.0ms | 1.06× | ✅ ok |
| step_p50 | 28.3ms | 30.5ms | 1.08× | ✅ ok |
| step_search_p50 | 30.0ms | 29.6ms | 0.99× | ✅ ok |
| stepMatch_p50 | 22.8ms | 23.6ms | 1.03× | ✅ ok |
| commit | 152.6ms | 155.6ms | 1.02× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
denolfe
added a commit
that referenced
this pull request
Sep 9, 2026
- feat: copy selected text (#58) (a9f836e) - fix(hr): stop adding a resize listener per horizontal rule (#57) (beedc6d) - ci: add first-frame and scroll benchmarks to the PR bench job (#56) (b7ab07d) - perf: improve first frame and progressive-mount speed, optimize large documents (#54) (3b6d9f2) - chore(ci): pin bun 1.4.1 via mise (#53) (f596175)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the PR bench job to gate first-frame mount time and per-step scroll latency, not just
--renderstartup. Both harnesses now emit machine-readable JSON, and a new comparison mode diffs the PR against a baseline built from main.The recent progressive-mount work moved the first-frame and scroll numbers, but CI still measured only
--renderstartup. A regression in mount or scroll latency could merge unnoticed. This wires the existingbench/first-frame.tsxandbench/scroll.tsxharnesses into the same PR gate.Key Changes
first-frame.tsxandscroll.tsxgain--json, printing one metrics payload per doc.first-frame.tsx --runs Nrelaunches itself N times and reports the p50 (median sample). Process startup is part of first-frame and can only be sampled across fresh processes.bench-compare.tsgainscompareMetricsandrenderMetricTable. A--metricsCLI mode diffs two harness payloads and gates on the existing warn/fail ratios.--appendstacks the render, first-frame, and scroll tables into one sticky comment.main.ymlgenerateslarge.md, then runs both harnesses on the PR and baseline builds. All three tables post to the PR.Design Decisions
--jsonflag, so CI copies the PR harness scripts into it. Both builds then run identical measurement code against differentsrc.continue-on-error, matching the job-level setting. A regression annotates the sticky comment but never blocks merge.Overall Flow
Previously the bench job ran a single hyperfine
--rendercomparison. The flow now adds harness runs on both builds and a JSON diff:References / Links