Skip to content

perf(types): check declaration values per property and add app-scale type benches - #515

Merged
jxom merged 1 commit into
mainfrom
perf/type-benches
Oct 27, 2026
Merged

jxom merged 1 commit into
mainfrom
perf/type-benches

Conversation

@jxom

@jxom jxom commented Oct 27, 2026

Copy link
Copy Markdown
Member

Follow-up to #513. Adds app-scale type benchmarks and trims declaration checking further. Types only; no API change.

Changes

  • Value.AcceptedValue / Value.CheckedValue: check a declaration value against its property directly, instead of through a one-key Record/Pick wrapper, so TypeScript caches each check per (value, property, tokens). Style.AcceptedMember calls them directly.
  • Value.Scalar: a dimension is matched against every unit suffix only when a range rule can reject it (negative, or required positive). That unit matching was the largest single cost, about 275k instantiations on the fixture.

Benchmarks

  • New src/default.bench-d.ts: app-scale authoring against the bundled default theme (token declarations, mixed literal/token, nested conditions, repeated declarations, a recipe).
  • New create / configured styles with shorthands case in Config.bench-d.ts, covering Configuration.Body.
  • All baselines reset with pnpm update:types. They were stale from before perf(types): check style declarations by key and value #513 (many cases 30–90% under).

Results

Fixture: Pyramid apps/web config plus its 2,040 style and 258 variants calls, TypeScript 7 (tsgo), single thread.

instantiations check time
before #513 5.61M 23.3 s
#513 (main) 3.24M ~16.5 s
this PR 2.83M (−12.4%) ~15.2 s

The new default-theme benches drop 20–35%. No bench case regressed (66 cases).

Checks

  • pnpm check:types: clean, so every @ts-expect-error in *.test-d.ts still fires.
  • pnpm bench:types: all fixtures pass.
  • vp fmt and vp lint on changed files: clean.
  • Language service completions (keys, nested keys, token values) match main.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T21:38:07.488569Z 518b8b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage report too large to inline, see the workflow summary.

@github-actions

Copy link
Copy Markdown
Contributor

Site preview

Open preview

Commit: 518b8b6ff5dcafe11e56c7b36c3c384a5f881b84

@pkg-pr-new

pkg-pr-new Bot commented Oct 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/zyzz@515

commit: 518b8b6

@github-actions

Copy link
Copy Markdown
Contributor

Examples

Example URL Status
api-react Open ✅ Deployed
cli-react Open ✅ Deployed
vite-react Open ✅ Deployed
vite-solid Open ✅ Deployed
vite-svelte Open ✅ Deployed

@jxom
jxom merged commit eb2eab7 into main Oct 27, 2026
57 of 58 checks passed
@jxom
jxom deleted the perf/type-benches branch October 27, 2026 22:07
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