Performance
Every number in this section is read from a file a script in this repository writes; a missing file reads not measured.
Markdown version of this page, for assistants (Markdown for AI)
On this page
Key numbers
| Subject | Value | Source |
|---|---|---|
| Behavior JavaScript of a page with native primitives only (button, dialog, popover) | 0 B | native-only fixture |
| Tabs behavior with the shared kernel, for any number of tab lists | 1839 B brotli | Budgets |
| A thousand tabs roots: ready, first click | 68.6 ms, 1.9 ms | Results |
| Table, a thousand rows: mount, sort | 287.3 ms, 156.1 ms | Results |
| Modal dialog, library JavaScript: Svelte Lean, Bits UI | 0 B brotli, 12378 B brotli | Comparison |
Production builds, Vite 7.3.6, Svelte 5.57.1; timings are medians in Chromium on AMD EPYC 9555P 64-Core Processor; the comparison excludes Svelte's own runtime on both sides (Bits UI 2.19.3).
What is measured
- Bytes of every entry point (raw, gzip, brotli) against its budget.
- What consumer applications ship, asserted module by module in production builds.
- Listeners at one and a thousand roots, counted by the runtime and by an independent
addEventListenerwrapper. - Startup and interaction timings, each as its own entry, never one score.
- Heap, DOM nodes and listeners after repeated mount and unmount.
What is not claimed
- No comparison beyond the published one: the Bits UI cases in benchmarks/compare, with their source and versions.
- No cross-browser numbers: Chromium only; Firefox and WebKit runs do not exist yet.
- No promise from a timing: it describes the recorded environment.
Every public claim and its evidence: docs/proof/claims.md.
Shipping invariants
Release-blocking, from ADR 0005.
| Invariant | Where it is tested | Status |
|---|---|---|
| A. Native-only pages ship no behavior runtime | fixtures/native-only; packages/primitives/scripts/size.mjs (native-only build) | passing |
| B. Unused behaviors are absent from production output | fixtures/tabs-only, tabs-and-menu, manual-registration, table-basic | passing |
| C. Instance count does not multiply shared listeners | apps/playground/tests/primitives/listeners.spec.ts (1 versus 1000 roots); packages/primitives/tests/tabs.test.ts | exact assertion in the browser suite |
| D. Tier 2 state is lazy | packages/primitives/tests/autocomplete.test.ts and select.test.ts; apps/playground/tests/primitives/lazy.spec.ts (no controller until a root is used, released on close) | exact assertion in the browser suite |
| E. Compatibility code is opt-in | No compatibility module exists yet; the first one comes with a fixture. | not applicable yet |
Fixture status from fixtures/results.json (yarn test:fixtures, Node v22.23.3).
Proof hierarchy
| Level | What it proves | Where |
|---|---|---|
| Level 1 · Architecture | Each contract declares tier, events and native base; tests assert the root entry registers nothing. | packages/primitives/src/<name>/contract.md and contract.ts |
| Level 2 · Build | Consumer fixtures assert which modules ship; size scripts record every entry point. | fixtures/results.json, packages/*/artifacts/size.json |
| Level 3 · Runtime | Listener counts at one and a thousand roots, keyboard and focus, JavaScript disabled, timings. | apps/playground/tests, and live on the proof page of this site |
| Level 4 · Application | This site runs on the packages it documents; the Settings demo composes primitives and the table. | apps/docs, /demos/settings |
Read next
- Methodology: how each number is produced and reproduced.
- Budgets: the limit next to each measured size.
- Results: every measurement with its environment.
- Proof: the live runtime of this site.