Skip to content

bench: add per-tier cold start and rss benchmarks - #116

Draft
natemoo-re wants to merge 2 commits into
mainfrom
claude/framework-stacking-perf-e67fd9
Draft

natemoo-re wants to merge 2 commits into
mainfrom
claude/framework-stacking-perf-e67fd9

Conversation

@natemoo-re

Copy link
Copy Markdown
Member

What does this PR do?

Adds cold-start benchmarks that measure what a CLI pays before its first frame, split by tier, so the cost of stacking a framework on @clack/ui and @bomb.sh/tty is measured instead of guessed.

packages/ui/bench/startup.bench.ts spawns a fresh Node process per tier. Each fixture in packages/ui/bench/startup/ reports time since process start and peak RSS. The benchmark prints the medians as a table and fails when a tier's peak RSS above bare Node exceeds its budget. Wall time is tracked by CodSpeed like the existing render benchmarks.

Local results (macOS, Node 24):

Tier Ready p50 Peak RSS Over node
node 16 ms 45.6 MB 0
tty (createTerm 80×24) 27 ms 57.7 MB +12.1 MB
@clack/ui import 44 ms 62.2 MB +16.6 MB
@clack/ui first frame (100 rows) 51 ms 64.6 MB +19.0 MB
preact first frame (same 100 rows) 56 ms 64.9 MB +19.2 MB

Notes

  • Fixtures are plain .mjs that import the built package. Loading .ts through Node's type stripping adds its own memory and startup time. The root bench script now runs pnpm build first.
  • Budgets apply to RSS only. Local wall time varies too much between runs to gate on.
  • Budgets (18 / 26 / 30 / 30 MB) are roughly 1.5× the macOS numbers. They may need tuning after the first Linux CodSpeed run.
  • Only tiers that render today are included. React and Vue get tiers when their DOM profiles pass; /parsing and /custom-elements get tiers when those entry points land.
  • Adds preact as a devDependency and a knip entry for the fixtures, which are spawned by path.

@socket-security

socket-security Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpreact@​11.2.010010010098100

View full report

@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

commit: 0fa0ecb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant