Repository navigation
feat: complete profiling counter core - #1955
Merged
Merged
Conversation
trueadm
marked this pull request as ready for review
October 9, 2026 21:46
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 28bc254 | Commit Preview URL Branch Preview URL |
Oct 09 2026, 10:00 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 28bc254 | Commit Preview URL Branch Preview URL |
Oct 09 2026, 10:03 PM |
Contributor
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)
101 other measured values are unchanged. |
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
Completes the remaining Phase 1 counter core from #1886. A profiling session now reports 60 engine counters, bounded accepted-root commit history through
getCommits(), and exclusive component counters insummary(). Commit IDs are separate from scheduler drains; delayed effects and lifecycle actions keep the transaction that queued or published them, including retained offscreen work and staged Activity cleanup.Adds probes for lists, effects and refs, lite/deopt/cache paths, boundary transitions, Activity, View Transitions, rollback kinds, flush priorities, host tasks, suspension strata, and layout/render replays. Session totals include discarded attempts; eviction, stop/clear behavior, unsupported counters, and units are documented. The counter schema advances to 2 with a minor changeset.
The cache-hit probe lives in the compiler's actual hit branch because
compilerCacheContextalso runs on misses. It calls an observer installed on the existingcompilerMemoRegionhelper, so optimized modules acquire no profiling-module dependency. Counter slots use strip-compatible TypeScript for direct Node server loading. Every new runtime reference remains behind the existing profiling define. An automated identity gate covers index/universal exports, five minimal fixtures, js-framework, TodoMVC, and chat in development and production, keeping identifiers stable.Validation
pnpm sync; no generated changes.pnpm format:files:checkfor all changed files.pnpm typecheck:filesfor the runtime, profiler, host-task helper, and bundle test.octane-profile: 40 integration tests, including multi-root drains, failed attempts, delayed effects, offscreen publication, staged cleanup, bounded history, and each new probe family.octane: 153 tests across profiler API, auto-memo, and production-profile bundle suites; 11 development/guard/production stripping tests. Vite integration profile bundle test also passes.OCTANE_PROFILE_STRIP_BASE=7bb02657b4bundle test: code-identical against the pre-change runtime across all 20 entry/mode combinations; profiling module contributes zero bytes when off. Ordinary CI runs compare against source-level probe erasure.node benchmarks/bundle-size/run-minimal.mjs hooks-state suspense-transitionandnode benchmarks/bundle-size/run.mjs octane-tsrx octane-jsx.28bc25463c.Perf review
node scripts/perf-review-scan.mjsreports 0 candidates, with no unresolved findings. Per-node/list/render probes (runtime.ts) increment numeric typed-array slots; transaction and component tables live inprofiling.ts:428-540, outside hot renderer records. No fields are added to Block, Scope, or LiteBlock. No DOM reads/writes, render requests, or task scheduling behavior are added. The emitted cache probe (compile.js:27204) and all runtime probes disappear under the off define, verified against the pinned base.Each retained transaction/component counter table holds 60 doubles (480 bytes); commit/component retention is independently bounded by
bufferSize. Weak maps attach pending work to existing objects. Exported records copy numeric/string metadata and retain no application objects.node benchmarks/js-framework/profile-overhead.mjs 9compares the same profile-compiled program with counter work disabled, global counters only, and full attribution. Component timing stays on and timeline output stays off. Darwin arm64, Chromium 149.0.7827.55, 3 warmups and 9 samples per operation with rotating lane order and DOM-result verification:These are measured medians, not speedup claims; small differences and sub-millisecond ratios are inconclusive at this timer resolution. This run measures counters/attribution; timeline cost is unchanged and was not measured.
The current-head PR benchmark passes: all 64 production work counters and all 60 application bundle-size values are unchanged, and all 20 timings are within noise. All reachability raw sizes are unchanged; binding gzip/Brotli changes range from −17 to +69 bytes. The stable-identifier gate above checks code identity independently of minifier naming.
concise-code: shipped source +599/−50 (client runtime +195/−7). Extends the existing recorder and transaction/effect queues; no new runtime module, option, or renderer field. New subpath types describe commit history; numeric probe/attribution helpers serve the runtime and compiler. The only new executable file is the repeatable overhead benchmark. Rejected event-derived detail (roughly 60 lines, loses counters after eviction and misses non-component work) and drain-ID grouping (roughly 40 lines, merges separate roots and misattributes delayed effects). Normal bundles are code-identical with profiling off. Local minimal gzip: hooks-state 25,174 bytes; suspense-transition 42,798 bytes. CI byte reports remain authoritative.Risk / follow-ups
<Profiler>, and DevTools counter UI remain later phases of Profiling mode: count and trace engine work (renders, hooks, Blocks, arms, boundaries, rollbacks) and add <Profiler> #1886.block.cacheHitis exercised using an independently optimized dependency against the profiling runtime; precise coverage remains the production work oracle.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches commit/effect scheduling and root transaction paths across the DOM runtime with many new guarded probes; profiling-off identity is tested but the surface area in
runtime.tsis large.Overview
Finishes the Phase 1 profiling counter core: counter schema 2 with 60 engine counters (lists, effects/refs, boundaries, Activity, scheduler/flushes, rollbacks, etc.), all behind existing
__OCTANE_PROFILE_ENABLED__guards.Profiler APIs:
getCommits()returns bounded accepted-root commit history (separate from drain IDs) with per-commit counters; delayed effects/refs attribute back to the transaction that queued them.summary()adds exclusive per-componentcountersandtruncatedwhen detail is evicted.bufferSizenow caps events, commits, and component counter rows together.Instrumentation:
runtime.tsandhost-task.tswire probes through__profileCount/ transaction helpers; the compiler emitsblock.cacheHiton memo region cache hits viacompilerMemoRegion.__profileHit.Tooling & docs: New
profile-overhead.mjsbenchmark; expanded profiling/devtools docs; integration tests for attribution and probes; production bundle tests assert profiling-off builds stay code-identical (optionalOCTANE_PROFILE_STRIP_BASEbaseline).Reviewed by Cursor Bugbot for commit 28bc254. Bugbot is set up for automated code reviews on this repo. Configure here.