Skip to content

Commit ce5d58f

Browse files
committed
perf(signals): offset #4384 on the lane pages (enterLane else-chain, caught's source as a param)
next @ 1b32ff2 left the live server components floor 40 B under its recorded minified; #4384's keyed readers cost +62 B there. Folding enterLane's tail into one else-chain (same branches, no early returns) and taking caught()'s source as a defaulted parameter saves 34-41 B on the lane pages, so the floor stays at 115,203 B (recorded 115,217). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
1 parent 60cbddf commit ce5d58f

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎packages/signals/src/boundaries.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ function record(b: Boundary, node: Computed<any>, source = node): void {
181181
/** The reader goes to the fallback: recorded, and the output re-derives
182182
* (a no-op while the output's own pass is running — its post-check
183183
* decides). */
184-
function caught(b: Boundary, node: Computed<any>, error: unknown): void {
185-
let source = node;
184+
function caught(b: Boundary, node: Computed<any>, error: unknown, source = node): void {
186185
if (b._type === STATUS_ERROR) {
187186
// An error boundary waits on what THREW (`StatusError.source`), not on
188187
// the reader that saw it: the reader recovers the moment a refetch

‎packages/signals/src/core/lanes.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,11 @@ export function enterLane(l: Transaction, c: Computed<any>): void {
273273
// `stagedRead`): it has no committed world to re-derive on (#3969).
274274
// (A pass not joined: a held write beside a guess, #4336.)
275275
if (c._flags & REACTIVE_STAGED_READ && (guessed || c._flags & REACTIVE_JOINED)) stagedRead(c);
276-
return;
276+
} else if (sameLane(p, l)) setPassLane(l);
277+
else if (!under(p, l)) {
278+
if (!under(l, p)) linkLanes(p, l);
279+
setPassLane(l);
277280
}
278-
if (sameLane(p, l)) return setPassLane(l);
279-
if (under(p, l)) return;
280-
if (under(l, p)) return setPassLane(l);
281-
linkLanes(p, l);
282-
setPassLane(l);
283281
}
284282
/** Is `l` nested under `a` (an ancestor lane)? */
285283
function under(l: Transaction, a: Transaction): boolean {

‎scripts/size/scenarios.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,8 @@ module.exports = [
26772677
// An Errored heals when the last reader that caught its error is disposed (#4373, 2026-10-28, over next @ 6b792a95, after #4355; re-recorded over next @ b68942ca): cap 31.80 KB unchanged, recorded minified 96,978 -> 97,023 B (+45 B minified over next's record, measured locally on linux; every boundary-carrying scenario pays the same +38–52 B, inside its recorded minified except this one, which sat at its cap). A boundary's readers become a reader -> source map, so an error boundary waits on what threw only while a reader that caught it is alive. Correctness (Ryan's ruling on #4373). Recorded minified = measured.
26782678
limit: "31.80 KB",
26792679
// An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 96,989 -> 97,047 B (+58 B minified over next's record), measured locally (linux) at 31,811 B brotli. Recorded minified = measured; CI re-bases.
2680-
capMinified: 97024,
2680+
// Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 97,024 -> 97,045 B (+21 B minified over next's record), measured locally (linux) at 31,798 B brotli. Recorded minified = measured; CI re-bases.
2681+
capMinified: 97045,
26812682
alias
26822683
},
26832684
{
@@ -5776,7 +5777,8 @@ module.exports = [
57765777
// An Errored heals when the last reader that caught its error is disposed (#4373, 2026-10-28, re-recorded over next @ b68942ca): cap 41.56 KB unchanged, recorded minified 123,182 -> 123,228 B (+46 B minified over next's record), measured locally (linux) at 41,856 B brotli. A boundary's readers become a reader -> source map, so an error boundary waits on what threw only while a reader that caught it is alive. Correctness (Ryan's ruling on #4373). Recorded minified = measured; CI re-bases.
57775778
limit: "41.56 KB",
57785779
// An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 123,191 -> 123,249 B (+58 B minified over next's record), measured locally (linux) at 41,899 B brotli. Recorded minified = measured; CI re-bases.
5779-
capMinified: 123203,
5780+
// Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 123,203 -> 123,224 B (+21 B minified over next's record), measured locally (linux) at 41,966 B brotli. Recorded minified = measured; CI re-bases.
5781+
capMinified: 123224,
57805782
alias: pageAlias
57815783
},
57825784
{
@@ -6164,7 +6166,8 @@ module.exports = [
61646166
// An Errored heals when the last reader that caught its error is disposed (#4373, 2026-10-28, re-recorded over next @ b68942ca): cap 47.16 KB unchanged, recorded minified 140,442 -> 140,485 B (+43 B minified over next's record), measured locally (linux) at 47,463 B brotli. A boundary's readers become a reader -> source map, so an error boundary waits on what threw only while a reader that caught it is alive. Correctness (Ryan's ruling on #4373). Recorded minified = measured; CI re-bases.
61656167
limit: "47.16 KB",
61666168
// An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 140,451 -> 140,509 B (+58 B minified over next's record), measured locally (linux) at 47,516 B brotli. Recorded minified = measured; CI re-bases.
6167-
capMinified: 140463,
6169+
// Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 140,463 -> 140,485 B (+22 B minified over next's record), measured locally (linux) at 47,547 B brotli. Recorded minified = measured; CI re-bases.
6170+
capMinified: 140485,
61686171
alias: pageAlias,
61696172
conditions: solidConditions,
61706173
compile: { hydratable: true }

0 commit comments

Comments
 (0)