Repository navigation
perf: bring Lynx renderer to ReactLynx parity - #693
Merged
trueadm merged 1 commit intoAug 10, 2026
Merged
Conversation
trueadm
marked this pull request as ready for review
August 10, 2026 19:22
14 of 17 tasks
This was referenced Aug 11, 2026
[lynx-perf-live 1] Compact template-run teardown without lazy-state materialization
Huxpro/octane#43
Open
Closed
Closed
This was referenced Aug 23, 2026
4 of 5 tasks
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]>
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
Make large, production-compiled Octane Lynx mounts and first interactions faster than the equivalent real ReactLynx Snapshot workload without changing visible output, native events, refs, or first-screen behavior.
The final clean-install, same-machine benchmark on the latest rebased upstream head compares 21 warmed samples against pinned
@lynx-js/[email protected]:The 10,000-row mount is 5.3% faster and its first real native-event update is 9.5% faster. Empty startup and the 1,000-row mount remain slower; both native-update workloads are faster in this run, although sub-millisecond cases have considerable scheduling/GC variance.
Why
Previously, every eligible nine-host row became nine logical host records, roughly 20 transport commands, nine acknowledged public-handle snapshots, and six eagerly installed renderer-private selectors. ReactLynx compiles the same subtree into a shared Snapshot creator with compact dynamic slots. Closing that structural gap required changes across the compiler, renderer-neutral host contract, Lynx transport, and native host driver.
Changes
mainwithout losing its certified Three host-component/compact-leaf optimizations, linear-time topology placement, scope-aware events, or proportional Lynx commit-wire profiling.pnpm sync-generated parity-audit lockfile SHA-256 records and the user-app evaluation manifest; those files contain no unrelated behavioral changes.octaneand@octanejs/lynx.Validation
pnpm format:check— repository-wide command not run; changed files were formatted andgit diff --checkpassed.pnpm typecheck— aggregate command not run; all eight directly affected source/testing/type-test configurations passed.pnpm test— aggregate command not run; all relevant complete Vitest project groups passed on the rebased head: 12,469 tests, zero failures.The benchmark was rerun after a clean pnpm dependency installation. ReactLynx remains confined to the private benchmark importer; no Octane, Lynx, Three, plugin, or root production dependency gains React or Preact.
Risk / follow-ups
Provenance
agent-authored)Note
High Risk
Touches dual-thread Lynx transport, host/client drivers, and acknowledgement/handle lifecycle on the critical render path; incorrect compact-ACK or lazy-handle behavior could break refs, events, or stale-target checks despite extensive gates.
Overview
Speeds up large Lynx mounts by compiling repeated row trees into shared host programs and applying them via new transport ops (
mount-template-range,mount-template-run) with contiguous host/listener IDs, instead of one logical host and per-node ACK per row.The Lynx stack gains capability-negotiated compact acknowledgements (
compact-v1), lazy public handles andoctane-refselectors (installed on demand for refs/queries), and dense main-thread host state that materializes records only when observed. Background renderer config adds thetemplate-program-mountcapability; client and host drivers implement compact handle derivation, template program preparation, and batched PAPI application while keeping legacy paths for lists, portals, worklets, refs, and first-screen adoption.The
lynx-renderbenchmark now runs production-compiled Octane against pinned ReactLynx Snapshot on the same fake Element PAPI, with first-tap update timings, reachable-tree checksum parity, and structural gates (one shared program run, bounded wire commands, one compact ACK). Baseline ratio guards and changesets document the patch.Reviewed by Cursor Bugbot for commit 654001b. Bugbot is set up for automated code reviews on this repo. Configure here.