Skip to content

P3.5.3 — Comparative benchmark suite#107

Merged
dbanksdesign merged 3 commits into
mainfrom
feat/benchmark-suite
Jun 22, 2026
Merged

P3.5.3 — Comparative benchmark suite#107
dbanksdesign merged 3 commits into
mainfrom
feat/benchmark-suite

Conversation

@dbanksdesign

Copy link
Copy Markdown
Collaborator

Summary

  • Add benchmarks/ workspace package with a reproducible performance harness measuring 4 dimensions of TypeStyles performance against a 50-component reference design system
  • Include Vanilla Extract comparison using an equivalent reference app ported to recipe()/style()/createThemeContract() APIs
  • Add CI benchmark job with regression detection (20% timing / 5% size thresholds)
  • Add docs benchmarks page with methodology, results, and honest caveats
  • Fix reset() to clear registeredNamespaces (was a gap requiring manual cleanup in tests)

Key results (Apple Silicon)

Metric TypeStyles Vanilla Extract
Style registration (50 components) ~1.0 ms ~0.7 ms
Selector calls (~60-90 invocations) ~0.10 ms ~0.03 ms
Extracted CSS (semantic) 31.4 KB (4.7 KB gz) 30.5 KB (4.6 KB gz)
Extracted CSS (atomic) 19.0 KB (4.7 KB gz)
Runtime injection ~1.1 ms N/A
SSR collection ~1.1 ms N/A

Test plan

  • All 347 core tests pass
  • Benchmarks run and pass CI mode (bench:ci)
  • Docs site builds with new benchmarks page
  • TypeScript passes (tsc --noEmit in benchmarks/)
  • Full monorepo turbo run test passes (36 tasks)
  • CI passes on this PR

🤖 Generated with Claude Code

dbanksdesign and others added 3 commits June 22, 2026 12:52
Add a benchmarks/ workspace package with a reproducible performance harness
measuring four dimensions of TypeStyles performance against a 50-component
reference design system: CSS generation time, extracted CSS file size across
all naming modes, runtime injection latency, and SSR collection overhead.

Includes a Vanilla Extract comparison using the same 50-component design
system ported to recipe()/style()/createThemeContract() APIs.

Key results (Apple Silicon):
- Style registration: ~1.0ms (50 components + 8 token namespaces + 3 themes)
- Selector calls: ~0.10ms for ~90 invocations
- Extracted CSS: 19.0–31.4 KB raw (4.7 KB gzip) across naming modes
- SSR collection: ~1.1ms per request
- vs Vanilla Extract: comparable file sizes, both sub-2ms registration

Also:
- CI benchmark job with regression detection (20% timing / 5% size thresholds)
- Docs benchmarks page with methodology and honest caveats
- Fix: reset() now clears registeredNamespaces (was a gap in test cleanup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timing varies ~3x between Apple Silicon and CI VMs — a checked-in
baseline from one platform can't reliably gate the other. File sizes
are deterministic and platform-independent, so they're the only
regression signal in CI. Timing results are still printed for
visibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dbanksdesign dbanksdesign merged commit aff0a8c into main Jun 22, 2026
7 checks passed
@dbanksdesign dbanksdesign deleted the feat/benchmark-suite branch June 22, 2026 21:52
@github-actions github-actions Bot mentioned this pull request Jul 4, 2026
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