Repository navigation
perf(signals): mangle the store family's private fields - #4494
Conversation
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 detectedLatest commit: 1752f8d The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
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 |
Size (brotli, eager entry chunk)
|
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
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
Coverage Report for CI Build 41185182826Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage remained the same at 78.134%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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
…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>
Before: the store family's private fields (
famon a store target, andoverlaid,asked,woke,shallowon the family) had plain names, so the minifier kept them in full in every store bundle.After: they are
_fam,_overlaid,_asked,_wokeand_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,mapandrunstay 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 inpackages/signals/scripts/mangle-props.jsonat the next free short names (#4503); every existing pin keeps its name.Size vs next @ 4a4803c, measured locally (linux), brotli / minified:
app: compiled floor)signals: core floorsignals: + createStoresignals: + isPending/latestsignals: + until/refreshapp: render + one signalapp: hydrating (no stores)app: hydrating + every store primitive familyapp: CSRapp: CSR, observe tierapp: CSR, observe tier + attributionapp: compiled CSRapp: compiled hydratingpage: base server componentspage: live server componentspage: compiled base server componentspage: compiled live server componentspage: base + routerpage: live + routerMinified 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. Leavingfamunprefixed zeroes four of them (one +13 appears onapp: compiled CSR) but gives up most of the store savings: −16 instead of −65 minified oncreateStore, 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?
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-typesand the signals src typecheck are clean.The earlier red
jobrun failedasync-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