Skip to content

Commit 3a505c7

Browse files
docs(design): §15 — discovery constant decomposed (sync floor 57µs ≈ octane's async 60; gap is ~5µs/boundary machinery)
Co-authored-by: Cursor <[email protected]>
1 parent d8db8eb commit 3a505c7

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

‎packages/solid-signals/DESIGN-PATCH-CHANNEL.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,3 +887,42 @@ discovery constant — solid server signals/boundaries were 24% of shell
887887
CPU (read/runWithBoundaryErrorContext/recordSlot/NotReadyError throws),
888888
GC ~25%. That is §15 territory: boundary-setup + per-read costs, same
889889
family as the news per-element gap.
890+
891+
### 15. The discovery constant, decomposed (2026-08-23, morning)
892+
893+
Attempted spot-fixes, with the measurements that killed or kept them:
894+
- Error.stackTraceLimit=0 A/B: DEAD EVEN (101 vs 101 µs) — NotReadyError
895+
stack capture is NOT a cost; do not "fix" it.
896+
- FormData-plugin frames in heap profiles are one-time undici lazy-loading
897+
at startup, not per-render — discount loader frames before reading.
898+
- Slot flight-memory (#3003) rebuilt: WeakMap<ctx, Map> -> symbol-keyed
899+
plain object ON ctx, records mutated in place (single {s,v,d} shape).
900+
recordSlot was 12.7% of recurring allocation; it leaves the top-12 —
901+
but µs/shell does NOT move. Young-gen garbage at this scale is free.
902+
- ssrLoadingBoundary: parent contexts read without owner switches;
903+
reveal-group severing setContext (a context-map clone) now only paid
904+
when a group is in scope. Under noise floor. (All landed: d8db8eb3.)
905+
906+
THE DECOMPOSITION (the §15 result): a floor variant of the same page with
907+
every promise pre-stamped {s:1,v} — full content, zero async machinery —
908+
renders in 57 µs. Octane's ASYNC shell is 60. Our staggered shell is ~107.
909+
The sync render path is ALREADY at octane speed while emitting MORE HTML
910+
(9.7KB content vs 4.2KB fallback shell). The entire remaining shell gap is
911+
the per-pending-boundary constant: ~5µs × 10 boundaries = discovery run +
912+
NotReadyError throw/catch + deferred + serialized stub (~10µs total for
913+
the batch session, the largest single slice) + registerFragment + boundary
914+
owner/context ceremony. Cost is smeared across ~30 frames of 1-4% — a
915+
structural constant, not a hotspot.
916+
917+
WHAT WOULD ACTUALLY CLOSE IT (design questions, not spot fixes):
918+
- Stub-less shell protocol: today a record's PRESENCE in _$HY.r at hydrate
919+
time is how the client learns "server owns this async value" —
920+
sharedConfig.has() returns false for an unarrived record and the client
921+
computes fresh. A client-side deferred FACTORY (boundary registration
922+
creates pending records on demand; fulfillments create-or-resolve) would
923+
delete the whole shell stub session, but it rewrites the has()/load()
924+
contract and every consumer that branches on record presence.
925+
- Lighter boundary discovery: the ceremony (buffered ctx via
926+
Object.create, ~10 closures, error-context save/restore per phase) is
927+
per-boundary; a compiled or pooled boundary form could amortize it.
928+
Both belong to a protocol conversation with Ryan, not a solo increment.

0 commit comments

Comments
 (0)