Skip to content

Commit 8936213

Browse files
committed
perf(signals): drop trackedEffect's early exit, keep the break
The early exit cost +33-40 B minified on the router rows; the dep walk is a few field reads per run with no allocation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE
1 parent 70ceb02 commit 8936213

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ import {
4141
haltReactivity,
4242
haltReactivityAt,
4343
notifyEpoch,
44-
pendingNodes,
45-
transactions,
4644
txOf,
4745
resetUnhandledAsync,
4846
schedule,
@@ -317,8 +315,6 @@ export function trackedEffect(fn: () => void | (() => void), options?: NodeOptio
317315
} finally {
318316
if (__DEV__) setTrackedQueueCallback(false);
319317
}
320-
// Nothing staged and nothing held: no dep can commit unseen.
321-
if (!pendingNodes.length && !transactions.length) return;
322318
// A dep this run was served the committed value of (D-29) while a
323319
// different value is staged commits without a notify to it: its
324320
// subscriber walk predates the link. Re-run where that value commits

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export interface Transaction {
309309
}
310310
/** Live transactions — opened, unmerged, not landed. Scanned at every seam
311311
* while non-empty; nothing on the plain path. */
312-
export const transactions: Transaction[] = [];
312+
const transactions: Transaction[] = [];
313313
/** Observe tier: this flush parked its transaction (`holdStart` fired). */
314314
let holding = false;
315315
/** A transaction (listed here) or a lane (lanes.ts lists its own). */

0 commit comments

Comments
 (0)