Skip to content

perf: preclassify compiled DOM event categories - #1972

Merged
trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/static-event-categories
Oct 10, 2026
Merged

trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/static-event-categories

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Classify statically authored DOM events during compilation so applications can omit the runtime event-category tables. Dynamic event props and the public registration APIs continue to classify names at runtime. Both paths share the existing event record and listener installers, preserving capture/bubble ordering, late registration, root/portal ownership, and native controlled-input behavior.

The compiler uses private client imports and collision-safe aliases. Server, universal and Valdi output retain their existing contracts; explicit DOM targets and DOM native reads use the same specialization. Component-owned registration and module-prelude ordering are preserved. The staged-DOM scanner and descriptor-event benchmark retain their existing ownership boundaries after the source move. The eval sandbox bridge exposes only the two new compiler helpers, and the Rsbuild hot-module fixture resolves the private client ABI through its existing callable mock.

Matched complete production JavaScript against 4cc2a1ed700318846c8d93249550122bc86e3dfa, with Node 24.20.0 and the existing configurations:

Fixture Minifier Gzip before → after Gzip delta Raw delta Brotli delta
TSRX rows Oxc, canonical split 32,140 → 31,554 B −586 B −1,232 B −511 B
TSRX rows esbuild, ordinary unsplit 37,614 → 37,102 B −512 B −1,303 B −458 B
JSX rows Oxc 54,702 → 54,674 B −28 B +225 B −107 B
JSX rows esbuild 65,062 → 65,026 B −36 B +328 B −26 B
Full API ceiling Oxc 173,436 → 173,388 B −48 B +435 B −21 B
Full API ceiling esbuild 181,372 → 181,304 B −68 B +542 B −26 B

Totals include all emitted JavaScript assets. Final production assets are hash-identical to the measured candidate. The classification tables disappear from the static TSRX fixture and remain in the dynamic JSX/API controls. The latter have small raw growth despite compressed savings.

Validation

  • pnpm format:check — full workspace not run; explicit changed-file checks pass.
  • pnpm typecheck — full workspace not run; runtime, public index and event declarations pass the scoped check. The selected test program reports exactly the same nine diagnostics on baseline and candidate: the existing @tsrx/core declaration gap and existing callbacks in its compiler test. No additional diagnostics remain.
  • pnpm test — full workspace not run.
  • Targeted tests: 480 distinct selected executions across event propagation/capture, disabled and controlled controls, descriptor events, portals/rollback, hydration, helper shadowing, private runtime imports, production registration ownership, void export recognition, Web TypeScript, Valdi and renderer boundaries. Dev/prod run where applicable; compiler suites select their own modes. The final new/renderer checks use the repository's renderer registry/rules and frozen-AST/origin assertions.
  • New registration and alias behaviors pass against baseline. Deliberately removing static categories fails the static-first public delivery cases; removing capture publication fails both registration orders. Both are restored and green. The authored-name regression also caught the new helper alias collision before its repair.
  • Staged-DOM ownership check, performance source scan and the descriptor-event deterministic benchmark pass.
  • Original ordinary production benchmark: all 64 call/DOM/direct-insertion metrics exactly match, with actual fixture configurations and pinned source/artifact identities.
  • CI adapter follow-up: all 10 distinct eval boundary/corpus checks pass locally, including the prescribed source contracts and real capture/bubble counter behavior. The scoped config copies the repository sandbox resolver and allowlist unchanged; its task-local launcher was restored. The original Rsbuild browser case could not run locally because the cached React plugin is absent; the unchanged test subsequently passed in current-head CI.
  • Hydration conformance loader follow-up: the original event-listener file passes all 102 dev/prod executions after replacing its two ad hoc module loaders with the existing shared loader. Fixture source, compile IDs/options and all adoption/dispatch/detachment assertions are unchanged.
  • Independent final source/correctness/bytes/work/timing review, including the single follow-up's 32 raw groups, all 14 intervals, 843 source/configuration pins and eight artifacts.
  • Owning work: all 12 fresh-page observations preserve semantics and DOM work. Unfiltered production calls fall from 26,568 to 22,149 for static-first registration and from 26,844 to 22,428 for dynamic-first registration; all eight quiet checks are zero. Separate named-call and native-listener controls verify phase sharing, late registration, touch cancellation and resource release.
  • Prespecified owning timing: 64 independent fresh-browser groups, 10 warmup + 12 retained pairs per group, 1,408 total paired windows and 128 separate first cycles. Node 24.20.0 / Chromium 149.0.7827.55, 5 µs clock; every group and observation retained, with identical-byte controls.
  • Final pnpm sync; all 255 production files and the reviewed diff remain unchanged. Signed local commit verified.
  • Current-head CI: all 32 checks pass at 070e690a800a60fda8cad478c96655fdc7a771e2; no unresolved current review threads. The PR is ready and mergeable. The distinct CI timing observation and completed bounded follow-up are disclosed below.

Risk / follow-ups

The current-head CI benchmark reports a strictly positive JSX swap paired ratio of 1.05229 [1.02595, 1.09839] (30 pairs). Its displayed aggregate scores are 0.166 → 0.171 ms; their quotient is not the paired-ratio estimator. The repository’s “within noise” label does not establish equivalence. The earlier a3b505b0 and 4f9d2478 reports, produced from the same 255 production source files, are preserved; their more neutral results do not disprove the latest observation. All 64 work counters remain equal, which does not establish latency. One bounded matched fresh-group JSX swap follow-up is complete below; it did not reproduce a statistically resolved slowdown, but does not disprove this CI observation.

The one prespecified local JSX swap follow-up retained all 32 fresh-browser groups (16 candidate and 16 identical-code controls), 320 warmup + 384 measured pairs and 32 separate first-swap pairs. Its independent group-mean comparison is 1.01215 [0.98044, 1.01767]: no statistically resolved local slowdown, with an upper bound of +1.77%. The identical-code control is narrowly positive, 1.00992 [1.00010, 1.02134], and has positive creation/execution-order partitions. All observations remain included; no control normalization or repeat was used to remove those effects. This limits attribution and does not establish equivalence or disprove the original CI observation under its different host/history.

The local comparison reused the frozen ordinary esbuild/no-split production assets, original swap operation and all 1,000 survivor/text checks. Both sides used the same odd repeat within each group (149–183); retained windows were 23.875–37.685 ms. First swaps, taken after the original three mount/clear warmups but before any swap warmups, were recorded separately: candidate 0.97202 [0.93301, 1.01980] at approximately 0.950–1.360 ms. This is a fresh-operation check, not cold-start or full preceding CI history. All source/artifact, clock, style and seeded-input gates passed. No additional swap run or source change followed this result.

Static registration emits an additional numeric array and both registration paths call a shared installer once per newly registered phase. This transfers classification to compilation and changes cold registration work; dispatch bodies and event-record shapes are unchanged.

Local warmed root-lifetime timing is inconclusive: candidate/base 1.00485 [0.95886, 1.02927], with a 95% upper bound of +2.93%; the identical-code control is 1.01188 [0.98663, 1.03214]. Both cohorts have strong creation/execution-order effects. Positive candidate partitions remain recorded, including baseline-created-first 1.02258 [1.01526, 1.03463] and candidate-executed-first 1.08006 [1.02839, 1.12217]. These are not discarded or proved to be noise, and root performance equivalence is not established.

The local portal-lifetime lane is 0.97721 [0.97067, 0.98667], with identical control 0.99558 [0.98502, 1.00837]; this does not imply an application-wide speedup. First-cycle estimates are coarse: root 0.98857 [0.78723, 1.22653] at approximately 0.150–0.275 ms, portal 0.94251 [0.92708, 1.06707] at 0.810–1.080 ms. Import measurements include chunk loading, parsing and evaluation, so there is no isolated classification or cold-start guarantee.

The initial calibration cap was too small to reach the 20 ms target on both sides; its slower candidate root sample (baseline/head 19.110/23.225 ms) is preserved. A reviewed cap-only increase selected common repeats of 5,103 root cycles and 2,566 portal cycles before collection; its root calibration was also directionally slower (22.080/23.415 ms). Retained windows subsequently ranged 15.615–34.080 ms for roots and 11.780–16.355 ms for portals. No repeats were retuned or samples excluded after collection.

This is a scoped bundle reduction with finite local evidence, not a universal performance guarantee or completion of the broader bundle-size target. Current-head CI is green and the single JSX swap follow-up is complete with the limits above. Joint latency for the broader combined bundle-reduction candidate has not been qualified by this individual PR.

Provenance

  • An agent produced this diff (agent-authored)

Origin: Codex task, implementation subtask duplication_audit, host com-79386. Key choices: fixed baseline, shared category definition and existing event record, private DOM-only compiler ABI, independently reviewed source/correctness with matched complete-bundle and production-work evidence; local latency uncertainty, the distinct CI observation and the bounded JSX swap follow-up remain explicit; current-head CI is green.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Changes core delegated event registration and classification paths used for capture/bubble ordering and React-parity dispatch, though behavior is heavily regression-tested and dynamic APIs remain.

Overview
Preclassifies statically authored DOM event handlers at compile time so production bundles can skip shipping the runtime event-category tables, while dynamic registration (delegateEvents / delegateCaptureEvents) still classifies names when modules load.

Event category bits and delegatedEventFlags() move into event-names.js (shared by compiler and runtime). For eligible DOM client output, the compiler emits __delegateEvents / __delegateCaptureEvents via octane/internal/client with parallel name + flag arrays; explicit __runtimeImportRoutes and non-DOM targets keep the public registration ABI. Runtime registration is refactored around shared registerDelegatedBubble / registerDelegatedCapture installers that read stored flags on each DelegatedEventType instead of re-deriving capture/target-only/discrete behavior from the event name.

Tests and tooling follow the new contract: registration lifetime/propagation cases, helper-alias shadowing for the __ helpers, private-runtime import boundaries, eval sandbox re-exports, staged-DOM ownership keys, and the descriptor-events benchmark’s catalog probe scoped to isDelegatedEventProp.

Reviewed by Cursor Bugbot for commit 545ffd0. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work labels Oct 10, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 10, 2026 08:57
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 31 value(s) increased
  • 🔴 bundle-reachability: 10 value(s) increased

Compares 6101f6670, the merge commit's first parent with 642b6a5c1 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

target operation base ms head ms head/base 95% CI
octane-jsx swap 0.164 0.152 −5.3% −7.4% … −3.6% 🟢 faster
All 20 timed operations (19 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.317 2.275 −1.7% −4.2% … +0.0% ⚪ within noise
octane-tsrx replace 5.017 5.117 +1.9% −1.9% … +3.8% ⚪ within noise
octane-tsrx add 2.150 2.167 ±0.0% −0.0% … +0.0% ⚪ within noise
octane-tsrx update 0.118 0.118 +1.2% −0.5% … +2.6% ⚪ within noise
octane-tsrx select 0.005 0.005 ±0.0% −1.1% … +0.8% ⚪ within noise
octane-tsrx swap 0.015 0.015 −0.6% −1.7% … −0.3% ⚪ within noise
octane-tsrx remove 0.012 0.012 −1.5% −3.0% … +1.0% ⚪ within noise
octane-tsrx runlots 21.658 22.042 +0.7% −0.9% … +1.9% ⚪ within noise
octane-tsrx select_lots 0.005 0.005 +3.1% +0.9% … +5.2% ⚪ within noise
octane-tsrx clear 40.125 39.767 +0.9% −0.8% … +1.8% ⚪ within noise
octane-jsx run 3.075 3.075 ±0.0% −3.0% … +3.1% ⚪ within noise
octane-jsx replace 5.600 5.500 −2.5% −3.7% … ±0.0% ⚪ within noise
octane-jsx add 2.892 2.875 −0.0% −1.6% … ±0.0% ⚪ within noise
octane-jsx update 0.238 0.228 −2.9% −5.1% … −0.7% ⚪ within noise
octane-jsx select 0.127 0.120 +0.6% −3.1% … +1.1% ⚪ within noise
octane-jsx swap 0.164 0.152 −5.3% −7.4% … −3.6% 🟢 faster
octane-jsx remove 0.158 0.155 −1.5% −3.8% … +0.3% ⚪ within noise
octane-jsx runlots 25.725 25.750 +0.7% −1.3% … +3.6% ⚪ within noise
octane-jsx select_lots 1.365 1.315 −3.0% −3.9% … −1.3% ⚪ within noise
octane-jsx clear 43.350 43.183 +0.4% −1.3% … +1.2% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 94,333 93,101 −1,232 (−1.3%) 🟢
octane-tsrx js_gzip 31,373 30,804 −569 (−1.8%) 🟢
octane-tsrx js_brotli 28,021 27,543 −478 (−1.7%) 🟢
octane-tsrx app_raw 6,948 6,954 +6 (+0.1%) 🔴
octane-tsrx app_gzip 2,338 2,336 −2 (−0.1%) 🟢
octane-tsrx fw_raw 87,385 86,147 −1,238 (−1.4%) 🟢
octane-tsrx fw_gzip 29,035 28,468 −567 (−2.0%) 🟢
octane-tsrx fw_brotli 25,982 25,504 −478 (−1.8%) 🟢
octane-tsrx todo_js_raw 103,854 104,060 +206 (+0.2%) 🔴
octane-tsrx todo_js_gzip 34,917 34,902 −15 (−0.0%) 🟢
octane-tsrx todo_js_brotli 30,964 30,959 −5 (−0.0%) 🟢
octane-tsrx todo_app_raw 4,626 4,641 +15 (+0.3%) 🔴
octane-tsrx todo_app_gzip 2,223 2,237 +14 (+0.6%) 🔴
octane-tsrx todo_app_brotli 1,894 1,899 +5 (+0.3%) 🔴
octane-tsrx todo_fw_raw 99,228 99,419 +191 (+0.2%) 🔴
octane-tsrx todo_fw_gzip 32,694 32,665 −29 (−0.1%) 🟢
octane-tsrx todo_fw_brotli 29,070 29,060 −10 (−0.0%) 🟢
octane-tsrx chat_js_raw 103,195 103,400 +205 (+0.2%) 🔴
octane-tsrx chat_js_gzip 34,769 34,798 +29 (+0.1%) 🔴
octane-tsrx chat_js_brotli 30,993 31,038 +45 (+0.1%) 🔴
octane-tsrx chat_app_raw 5,771 5,783 +12 (+0.2%) 🔴
octane-tsrx chat_app_gzip 2,717 2,726 +9 (+0.3%) 🔴
octane-tsrx chat_app_brotli 2,384 2,389 +5 (+0.2%) 🔴
octane-tsrx chat_fw_raw 97,424 97,617 +193 (+0.2%) 🔴
octane-tsrx chat_fw_gzip 32,052 32,072 +20 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 28,609 28,649 +40 (+0.1%) 🔴
octane-tsrx weather_js_raw 141,274 140,049 −1,225 (−0.9%) 🟢
octane-tsrx weather_js_gzip 46,870 46,297 −573 (−1.2%) 🟢
octane-tsrx weather_js_brotli 41,299 40,761 −538 (−1.3%) 🟢
octane-tsrx weather_app_raw 22,161 22,174 +13 (+0.1%) 🔴
octane-tsrx weather_app_gzip 7,844 7,857 +13 (+0.2%) 🔴
octane-tsrx weather_app_brotli 6,653 6,650 −3 (−0.0%) 🟢
octane-tsrx weather_fw_raw 119,113 117,875 −1,238 (−1.0%) 🟢
octane-tsrx weather_fw_gzip 39,026 38,440 −586 (−1.5%) 🟢
octane-tsrx weather_fw_brotli 34,646 34,111 −535 (−1.5%) 🟢
octane-tsrx bindings_js_raw 678,408 678,716 +308 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 223,592 223,483 −109 (−0.0%) 🟢
octane-tsrx bindings_js_brotli 190,266 190,143 −123 (−0.1%) 🟢
octane-tsrx bindings_app_raw 347,653 347,742 +89 (+0.0%) 🔴
octane-tsrx bindings_app_gzip 115,683 115,670 −13 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 96,211 96,179 −32 (−0.0%) 🟢
octane-tsrx bindings_fw_raw 330,755 330,974 +219 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 107,909 107,813 −96 (−0.1%) 🟢
octane-tsrx bindings_fw_brotli 94,055 93,964 −91 (−0.1%) 🟢
octane-tsrx full_fw_raw 573,000 573,435 +435 (+0.1%) 🔴
octane-tsrx full_fw_gzip 173,299 173,260 −39 (−0.0%) 🟢
octane-tsrx full_fw_brotli 145,697 145,807 +110 (+0.1%) 🔴
octane-jsx js_raw 168,443 168,668 +225 (+0.1%) 🔴
octane-jsx js_gzip 54,669 54,615 −54 (−0.1%) 🟢
octane-jsx js_brotli 47,900 47,904 +4 (+0.0%) 🔴
octane-jsx app_raw 8,273 8,279 +6 (+0.1%) 🔴
octane-jsx app_gzip 2,858 2,860 +2 (+0.1%) 🔴
octane-jsx app_brotli 2,410 2,411 +1 (+0.0%) 🔴
octane-jsx fw_raw 160,170 160,389 +219 (+0.1%) 🔴
octane-jsx fw_gzip 51,811 51,755 −56 (−0.1%) 🟢
octane-jsx fw_brotli 45,490 45,493 +3 (+0.0%) 🔴
octane-jsx full_fw_raw 573,000 573,435 +435 (+0.1%) 🔴
octane-jsx full_fw_gzip 173,299 173,260 −39 (−0.0%) 🟢
octane-jsx full_fw_brotli 145,697 145,807 +110 (+0.1%) 🔴

1 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 85,116 84,713 −403 (−0.5%) 🟢
cli-spa-starter gzip 29,251 28,971 −280 (−1.0%) 🟢
cli-spa-starter brotli 25,991 25,788 −203 (−0.8%) 🟢
root-static-specialized raw 56,901 56,498 −403 (−0.7%) 🟢
root-static-specialized gzip 19,315 19,075 −240 (−1.2%) 🟢
root-static-specialized brotli 17,503 17,280 −223 (−1.3%) 🟢
root-chained-jsx raw 59,252 58,849 −403 (−0.7%) 🟢
root-chained-jsx gzip 20,037 19,758 −279 (−1.4%) 🟢
root-chained-jsx brotli 18,130 17,892 −238 (−1.3%) 🟢
root-static raw 148,356 148,414 +58 (+0.0%) 🔴
root-static gzip 48,124 48,068 −56 (−0.1%) 🟢
root-static brotli 42,403 42,384 −19 (−0.0%) 🟢
root-static-local raw 56,900 56,497 −403 (−0.7%) 🟢
root-static-local gzip 19,298 19,060 −238 (−1.2%) 🟢
root-static-local brotli 17,501 17,284 −217 (−1.2%) 🟢
root-callback-local raw 59,712 59,310 −402 (−0.7%) 🟢
root-callback-local gzip 20,152 19,879 −273 (−1.4%) 🟢
root-callback-local brotli 18,248 17,999 −249 (−1.4%) 🟢
hooks-state raw 69,874 68,645 −1,229 (−1.8%) 🟢
hooks-state gzip 23,373 22,808 −565 (−2.4%) 🟢
hooks-state brotli 21,170 20,663 −507 (−2.4%) 🟢
prop-attributes raw 67,074 65,845 −1,229 (−1.8%) 🟢
prop-attributes gzip 22,538 21,977 −561 (−2.5%) 🟢
prop-attributes brotli 20,368 19,874 −494 (−2.4%) 🟢
context raw 76,038 74,809 −1,229 (−1.6%) 🟢
context gzip 25,401 24,821 −580 (−2.3%) 🟢
context brotli 22,835 22,339 −496 (−2.2%) 🟢
hydrate-root raw 120,464 120,061 −403 (−0.3%) 🟢
hydrate-root gzip 39,361 39,092 −269 (−0.7%) 🟢
hydrate-root brotli 34,672 34,423 −249 (−0.7%) 🟢
deferred-hydration raw 204,811 203,579 −1,232 (−0.6%) 🟢
deferred-hydration gzip 65,428 64,858 −570 (−0.9%) 🟢
deferred-hydration brotli 56,684 56,193 −491 (−0.9%) 🟢
hydrate-frame raw 350,326 350,551 +225 (+0.1%) 🔴
hydrate-frame gzip 110,467 110,455 −12 (−0.0%) 🟢
hydrate-frame brotli 94,743 94,750 +7 (+0.0%) 🔴
suspense-transition raw 126,987 125,755 −1,232 (−1.0%) 🟢
suspense-transition gzip 40,748 40,188 −560 (−1.4%) 🟢
suspense-transition brotli 36,136 35,602 −534 (−1.5%) 🟢
component-owned-effects raw 60,542 59,314 −1,228 (−2.0%) 🟢
component-owned-effects gzip 20,495 19,926 −569 (−2.8%) 🟢
component-owned-effects brotli 18,584 18,077 −507 (−2.7%) 🟢
binding-hooks raw 70,456 69,227 −1,229 (−1.7%) 🟢
binding-hooks gzip 23,952 23,361 −591 (−2.5%) 🟢
binding-hooks brotli 21,658 21,152 −506 (−2.3%) 🟢
binding-base-ui-vite raw 187,377 187,433 +56 (+0.0%) 🔴
binding-base-ui-vite gzip 60,347 60,219 −128 (−0.2%) 🟢
binding-base-ui-vite brotli 52,762 52,730 −32 (−0.1%) 🟢
binding-base-ui-esbuild raw 214,538 214,755 +217 (+0.1%) 🔴
binding-base-ui-esbuild gzip 69,864 69,843 −21 (−0.0%) 🟢
binding-base-ui-esbuild brotli 60,778 60,731 −47 (−0.1%) 🟢
binding-aria-vite raw 7,391 7,116 −275 (−3.7%) 🟢
binding-aria-vite gzip 2,886 2,747 −139 (−4.8%) 🟢
binding-aria-vite brotli 2,541 2,433 −108 (−4.3%) 🟢
binding-aria-esbuild raw 8,603 8,157 −446 (−5.2%) 🟢
binding-aria-esbuild gzip 3,332 3,141 −191 (−5.7%) 🟢
binding-aria-esbuild brotli 2,982 2,809 −173 (−5.8%) 🟢
binding-radix-vite raw 187,737 187,795 +58 (+0.0%) 🔴
binding-radix-vite gzip 60,223 60,140 −83 (−0.1%) 🟢
binding-radix-vite brotli 52,738 52,625 −113 (−0.2%) 🟢
binding-radix-esbuild raw 214,684 214,901 +217 (+0.1%) 🔴
binding-radix-esbuild gzip 69,784 69,756 −28 (−0.0%) 🟢
binding-radix-esbuild brotli 60,590 60,588 −2 (−0.0%) 🟢
binding-mantine-hooks-vite raw 70,618 69,389 −1,229 (−1.7%) 🟢
binding-mantine-hooks-vite gzip 23,886 23,280 −606 (−2.5%) 🟢
binding-mantine-hooks-vite brotli 21,553 21,008 −545 (−2.5%) 🟢
binding-mantine-hooks-esbuild raw 82,138 81,340 −798 (−1.0%) 🟢
binding-mantine-hooks-esbuild gzip 28,249 27,971 −278 (−1.0%) 🟢
binding-mantine-hooks-esbuild brotli 25,275 24,996 −279 (−1.1%) 🟢
binding-apollo-client-vite raw 329,530 329,588 +58 (+0.0%) 🔴
binding-apollo-client-vite gzip 102,576 102,485 −91 (−0.1%) 🟢
binding-apollo-client-vite brotli 89,966 89,868 −98 (−0.1%) 🟢
binding-apollo-client-esbuild raw 364,709 364,926 +217 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 116,253 116,241 −12 (−0.0%) 🟢
binding-apollo-client-esbuild brotli 101,474 101,512 +38 (+0.0%) 🔴
binding-usehooks-ts-vite raw 71,400 70,171 −1,229 (−1.7%) 🟢
binding-usehooks-ts-vite gzip 24,119 23,532 −587 (−2.4%) 🟢
binding-usehooks-ts-vite brotli 21,732 21,293 −439 (−2.0%) 🟢
binding-usehooks-ts-esbuild raw 82,912 82,114 −798 (−1.0%) 🟢
binding-usehooks-ts-esbuild gzip 28,478 28,216 −262 (−0.9%) 🟢
binding-usehooks-ts-esbuild brotli 25,490 25,282 −208 (−0.8%) 🟢

30 other measured values are unchanged.

@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Good to go, with one cleanup nit and one follow-up worth considering. Classification is unchanged, and every path that can't be classified at compile time still uses the runtime classifier.

  1. Guard that looks unreachable (nit). I couldn't find a reachable case for the __runtimeImportRoutes clause in staticEventFlags.
    • Its only producers are the Valdi re-entry, which sets __valdiAbiGuard, and the universal re-entry, which sets __universal, so domSignalTarget already excludes both.
    • Neither route set imports delegateEvents, and option routes never carry locals.
    • Only the new test reaches it, so the clause and that test could both go.
  2. Category tables still ship with controlled inputs and form actions (follow-up).
    • Controlled value/checked reaches delegateEvents(RESTORE_EVENT_LIST), and a function form action reaches delegateEvents(['submit']). Both classify fixed names at runtime.
    • That likely explains why the todo and chat rows barely move (+191 to +206 B raw, −20 to −34 B gzip).
    • The fix: pass constant flags to __delegateEvents (input/change 48, click 112, submit 16), with a test that checks them against delegatedEventFlags. That would extend the saving to form apps.
    • Until then, the changeset's "applications with static handlers can omit … tables" overstates the saving a little.
  3. Contract note. Compiled output now contains the flag numbers themselves, so the EVENT_* bit layout is part of the compiler-to-runtime contract. A short "append-only; rename the helper if the layout changes" note at delegatedEventFlags would guard against silent skew between two octane copies.

Trivial: the comment at runtime.ts:33169 still says "see RESTORE_EVENTS", but that constant now lives in event-names.js.

Merge note: the conflicts with #1966 and #1967 are adjacent insertions at the top of INTERNAL_CLIENT_RUNTIME_HELPERS (compile.js:1656). Keep both sides.

Verified:

  • A head compile emits flags equal to the runtime classifier: click 112, load 260, scroll 12, mouseenter 140, focusin 16, custom 0. This includes the Capture suffix and the got/lostpointercapture exception.
  • Spreads, applyHostProps, descriptors, controlled arming and form actions keep the public path. Dispatch bodies are byte-identical to main.
  • Server output returns early via compileServer. Universal and Valdi keep the public helpers.
  • The static-first and dynamic-first registration tests discriminate on both early and late roots.
  • The bot rows match the PR table (rows −586 B gzip). All 64 work counters are unchanged, and perf-review-scan is clean.

@trueadm
trueadm merged commit 2075c0e into octanejs:main Oct 10, 2026
30 checks passed
@trueadm trueadm mentioned this pull request Oct 10, 2026
5 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants