Skip to content

perf(signals): mangle the store family's private fields - #4494

Merged
ryansolid merged 5 commits into
nextfrom
claude/project-thread-x1ore2-famrename
Oct 31, 2026
Merged

ryansolid merged 5 commits into
nextfrom
claude/project-thread-x1ore2-famrename

Conversation

@ryansolid

@ryansolid ryansolid commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Before: the store family's private fields (fam on a store target, and overlaid, asked, woke, shallow on the family) had plain names, so the minifier kept them in full in every store bundle.

After: they are _fam, _overlaid, _asked, _woke and _shallow, which the build mangles. Store bundles lose 65 to 150 B minified. There is no behaviour, type or public API change.

How: a rename across packages/signals/src (store/*, affects-marks.ts, deferred.ts, core/async.ts, core/seat.ts, core/verdict.ts) and two store tests. Nothing outside packages/signals reads these fields. live, node, st, opt, key, map and run stay unprefixed: they are read in core-side files, and prefixing them pushed hot core fields (_fn, _verdictLane, _gated) off one-character names, which grew every non-store bundle. The build pinned the five new names in packages/signals/scripts/mangle-props.json at the next free short names (#4503); every existing pin keeps its name.

Size vs next @ 4a4803c, measured locally (linux), brotli / minified:

scenario brotli minified
hello world (app: compiled floor) −9 (9,971 B) −2
signals: core floor −3 −2
signals: + createStore +41 −65
signals: + isPending/latest −12 −4
signals: + until/refresh −2 −2
app: render + one signal −31 −2
app: hydrating (no stores) −39 −2
app: hydrating + every store primitive family −64 −150
app: CSR −2 −2
app: CSR, observe tier +27 −2
app: CSR, observe tier + attribution +18 −2
app: compiled CSR −19 −67
app: compiled hydrating −8 −67
page: base server components −58 −5
page: live server components +23 −7
page: compiled base server components −17 −5
page: compiled live server components −8 −7
page: base + router +41 −5
page: live + router −12 −7
frames, server floor, renderToString 0 0

Minified drops in every changed scenario, and brotli falls by 134 B across the table. The five brotli rises all come with a minified drop: they are mangle-layout noise from _fam, which core files read (core/async.ts, core/verdict.ts), so even bundles without stores change by two bytes there. Leaving fam unprefixed zeroes four of them (one +13 appears on app: compiled CSR) but gives up most of the store savings: −16 instead of −65 minified on createStore, and 75 B less brotli saved overall. Three rows sit a few bytes over their brotli cap (observe tier +7, observe tier + attribution +2, live server components +5) but within 20 B of their recorded minified, so the gate passes. This PR changes no caps or records.

How did you test this change?

suite (after merging next @ 4a4803c) passed expected fail
signals 6,164 21
solid 918 0
web 1,599 7
web hydrate 716 10
web server 1,910 3

The one web server failure, server-functions-adapter-request.spec.tsx "keeps a rebuild failure's own error…", fails on plain next in the same environment. pnpm --filter @solidjs/web test-types and the signals src typecheck are clean.

The earlier red job run failed async-gen/store-unread-derive-e3.spec.ts ("an unread store's derive does not hold a plain write"): core/verdict.ts still read a derive's family as .fam, so the no-reader skip never fired. It now reads ._fam, and that spec passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2

Rename the store family link `fam` -> `_fam` (on store targets and on the
projection computed) and the StoreFamily fields `overlaid`, `asked`, `woke`
and `shallow` to `_`-prefixed names so the mangle-props pass shortens them.
Pure rename, no behavior change.

`live`, `node` and `st` stay unprefixed: they are read in core files
(affects-marks, async, seat, deferred) whose first-encounter slots in the
mangle order would push hot core fields (`_fn`, `_verdictLane`) to two-char
names, raising minified in every non-store scenario. `opt`, `key`, `map`
and `run` save one char each and their reshuffle cost more brotli than it
saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
@changeset-bot

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1752f8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@solidjs/signals Patch
test-integration Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
solid-js Patch
@solidjs/universal Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.41 KB −3 B (−0.0%) −2 B −5 B 7.43 KB ✅
signals: + createStore 14.96 KB +41 B (+0.3%) −65 B −65 B 14.99 KB ✅
signals: + isPending/latest 11.37 KB −12 B (−0.1%) −4 B −4 B 11.40 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.04 KB −2 B (−0.0%) −2 B −3 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.76 KB −31 B (−0.3%) −2 B −5 B 9.80 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.74 KB −39 B (−0.2%) −2 B −2 B 18.80 KB ✅ lazy-page.js 0.04 KB
app: hydrating + every store primitive family 32.47 KB −64 B (−0.2%) −150 B −142 B 32.51 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.43 KB −2 B (−0.0%) −2 B +11 B 13.47 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.21 KB +27 B (+0.2%) −2 B +11 B 15.20 KB ⚠️ over by 7 B, 9 B minified headroom lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.80 KB +18 B (+0.1%) −2 B −2 B 29.80 KB ⚠️ over by 2 B, 22 B minified headroom lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.97 KB −9 B (−0.1%) −2 B −3 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.29 KB −19 B (−0.1%) −67 B −67 B 26.36 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.53 KB −8 B (−0.0%) −67 B −67 B 32.56 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 33.69 KB −58 B (−0.2%) −5 B −5 B 33.81 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.18 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 39.10 KB +23 B (+0.1%) −7 B +9 B 39.10 KB ⚠️ over by 5 B, 11 B minified headroom assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.20 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.71 KB −17 B (−0.0%) −5 B −5 B 35.74 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.14 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 43.04 KB −8 B (−0.0%) −7 B −7 B 43.06 KB ✅ eager (counted): web.js 23.00 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.21 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.25 KB +41 B (+0.1%) −5 B −30 B 41.25 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.58 KB, trace.js 9.13 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 48.67 KB −12 B (−0.0%) −7 B −7 B 48.69 KB ✅ eager (counted): client.js 28.15 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.11 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.85 KB 0 B 0 B 0 B 22.87 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • app: CSR, observe tier (same app on the observe artifacts): over brotli cap by 7 B; minified 41,993 B vs 41,982 B recorded with the cap (+11 B) — 9 B of the 20 B minified allowance left; −2 B minified over this PR's base
  • app: CSR, observe tier + attribution engine enabled: over brotli cap by 2 B; minified 88,327 B vs 88,329 B recorded with the cap (−2 B) — 22 B of the 20 B minified allowance left; −2 B minified over this PR's base
  • page: live server components (base + live/GET + action + isPending/latest): over brotli cap by 5 B; minified 118,132 B vs 118,123 B recorded with the cap (+9 B) — 11 B of the 20 B minified allowance left; −7 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@codspeed

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 200 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing claude/project-thread-x1ore2-famrename (1752f8d) with next (322fa07)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Renames the old store-family field names that next's new code reads
(`target.fam`, `fam.woke`, a derive's `.fam`) to their `_`-prefixed
form, and points verdict.ts's derive-family check at `_fam` (it read
`.fam`, which a derive no longer carries, so the no-reader skip never
fired).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
The build added `_fam`, `_overlaid`, `_asked`, `_woke` and `_shallow` to
mangle-props.json at the next free short names; every existing pin keeps
its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
@ryansolid
ryansolid marked this pull request as ready for review October 31, 2026 08:35
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 41185182826

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 78.134%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1367
Covered Lines: 1129
Line Coverage: 82.59%
Relevant Branches: 1098
Covered Branches: 797
Branch Coverage: 72.59%
Branches in Coverage %: Yes
Coverage Strength: 29.82 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit e44f824 into next Oct 31, 2026
9 checks passed
ryansolid pushed a commit that referenced this pull request Oct 31, 2026
Resolve the _laneRebase keyFn lines over the store family rename (#4494)
and read the guess-site derive through `t._fam`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
ryansolid added a commit that referenced this pull request Oct 31, 2026
…4537)

Raises the compiled hydrating cap (32.56 -> 32.61 KB; minified fell 35 B,
the brotli rise is mangle layout from #4494) and re-records minified on six
rows that drifted toward the 20 B allowance. Floor caps are unchanged.


Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2

Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants