Repository navigation
perf: bring native hover allocations close to Solid - #1044
Merged
domgan-oai merged 3 commits intoSep 10, 2026
Merged
domgan-oai merged 3 commits into
domgan-oai merged 3 commits into
Conversation
domgan-oai
marked this pull request as ready for review
September 10, 2026 22:46
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 9ec3211. Configure here.
This was referenced Oct 3, 2026
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
…nch (#1651) frame_1k_subscribers regressed to 1.18-1.33x React Three Fiber at #1044. Octane's dispatch did not get slower. #1044 stopped retaining each effect's previous closures, and the bench built a fresh recordFrame callback on every render(). V8 inlines that callback into the frame loop; once Octane frees it, the runner's forced gc() before each sample clears it and deoptimizes the loop, so the timed frames re-warm V8. React keeps the old props alive through its alternate fibers, so R3F's call site goes polymorphic and stays optimized. Both pages now pass module-level checksum callbacks. On the unchanged runtime frame dispatch measures 0.81x R3F, and every three-renderer op stays below 1.0. Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
… to renderers that use them (#1652) * perf(octane): ship universal host bindings and template programs only to renderers that use them Weekly Bench's three-bundle-size guards breached at 1.059x (minimal) and 1.042x (full catalogue) of React Three Fiber. Since #677, octane-min grew 15.6 KB gzip, almost all of it in universal-core.ts (131 KB -> 178 KB minified). The largest additions were Lynx-only template paths (#693, #700, #716, #750) and opt-in host bindings (#1044). @octanejs/three itself was flat. - universalHostBinding() now installs the subscription, flush, and binding-only transaction code on its first call. The root keeps one lazy binding state instead of seven eager fields, and commits skip the per-host binding loops when no binding can exist. - Template programs are a driver opt-in: templateProgramMount, templateProgramRuns, and collapsedTemplateMount take effect only with `templates: universalHostTemplates`. The Lynx background driver passes it. Program preparation, collapsed-template materialization and expansion, and the compact template update now sit behind that object. octane-min 199019 -> 193811 gzip (1.031x), octane-full 260746 -> 255569 (1.021x). The guards ratchet to 1.034 and 1.024; reaching 1.0 needs a broader universal-core diet. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: split the Lynx changeset from the octane changeset The changeset check rejects a changeset that mixes the ignored private @octanejs/lynx package with octane. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
universalHostBinding(source, select)for ordinary properties on local direct native roots. A root shares one source subscription and publishes changed properties together without rerendering the component tree.Why
The reporter's issue and reproduction distinguish mounted retention from cumulative allocations. Releasing effect history fixes the mounted retention, but the hand-authored root
useStateroute still reconstructs 20 rows and 80 view layers on every hover. The new binding route lets that source update the two changed host properties in an accepted batch.Changes
useStatesource to a scoped signal and boundactiveprops; the original Solid workload and host/effect assertions remain intact. Reproduction commands are inbenchmarks/universal-native-hover/README.md.Validation
pnpm typecheck; scopedtsgo --noEmit -p packages/octane/tsconfig.jsonon the final core.prettier --check .(thepnpm format:checkcommand) and changed-file formatting checks.pnpm test— attempted locally; broad browser and unrelated package suites failed in this macOS environment. Current-head CI is the gate for the full matrix.Risk / follow-ups
useStateupdates still rebuild the hand-authored tree and retain their cumulative allocation cost. The measured opt-in path is about 1.58× Solid's cumulative bytes and 2.57× its mounted live bytes, with the same 8 MiB heap capacity. Controlled diagnostic substitutions attribute about 1.24 MB to the scoped signal versus a minimal source and about 0.90 MB to the reporter's host property traversal; neither substitution is in the final comparison.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches universal root commit/scheduling, subscription lifetimes, and effect hook retention in core
universal-core.ts; behavior is opt-in but errors and partial-failure paths are intricate.Overview
Adds opt-in
universalHostBinding(source, select)so local direct native roots can push{ get, subscribe }changes (e.g. scoped signals) straight to ordinary host props in one accepted driver batch, without rerunning the component tree. The root deduplicates subscriptions per source, wires bindings after host acceptance, uses a dedicated binding transaction path, and tears down on replace/hide/unmount; transported/bridge/event/compact-leaf cases are rejected.Separately, accepted universal commits clear superseded effect hook
previouslinks, so stable native renders with unchanged effect deps no longer keep old callback closures alive while mounted.Docs and the native-hover benchmark README document the binding API, Hermes repro steps, and a reporter patch; large regression and GC retention tests cover batching, aborts, scheduler failures, and cleanup.
Reviewed by Cursor Bugbot for commit cb5fced. Bugbot is set up for automated code reviews on this repo. Configure here.