You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depends on #112 (base: perf/benchmark-public-api), which is stacked on #111.
Changes
Parse trailing stack locations from the end instead of repeatedly matching the full location with a lazy regex; preserve line-terminator behavior.
Parse stack lines directly rather than splitting/filtering each already-split line.
Reuse parsed frames inside each hook-inspection tree build, skipping repeated parsing/classification of shared frames. No hook-value/result caching; no persistent inspection cache; public parseStack results remain fresh.
Use indexed reverse source-map scans and skip materializing later ignored matches once a valid fallback exists. Keep mutable-map behavior, first-duplicate semantics, and application-source preference.
Add distinct hook-call-site and ignored-mapping benchmarks to avoid optimizing only repeated-loop fixtures.
Replace executable benchmark strings with typed workers and an explicit 128-site TypeScript hook fixture. Compile the cold-import probe before starting native Node.
Validate report structure and exact timing summaries, source-content identity, hook values, and distinct call-site locations.
Give live fixtures independent setup/cleanup; share registration, variants, groups, statistics, process execution, and report formatting.
Journal completed groups incrementally. Interrupted runs retain their results without replacing the last successful report.
Simplify the root README's getSource description as requested.
No public export changes or changes to useFiber capture. Unrelated kitchen-sink work remains excluded.
Paired performance results
Historical production bundles before (35fe6a6) versus after, using identical expanded fixtures on local Node 24.20.0 / Apple M5 Max. The later typed-worker refactor changes fixture stack layout; these measurements are not comparisons across that refactor. Timings are diagnostic, not browser/mobile guarantees.
Workload
ESM before → after
CJS before → after
Inspect 128 state hooks
3.21 → 2.28 ms
3.74 → 2.83 ms
Inspect 128 custom-hook calls / 384 primitives
9.70 → 6.92 ms
11.39 → 8.50 ms
Inspect 128 distinct state-call sites
3.82 → 3.03 ms
4.36 → 3.56 ms
Parse 1,000 V8 frames
655 → 464 µs
633 → 470 µs
Source-content lookup / 10,000 filenames
183 → 40 µs
181 → 40 µs
Function-name lookup past 10,000 ignored mappings
121 → 59 µs
125 → 63 µs
Native Error capture and Node's source-map-aware stack formatting remain substantial costs. Inspection still replays user code; reverse lookups and deep ancestor walks remain linear. Machine-load variation was visible in other runs, so these are not timing thresholds.
Correctness and validation
New differential test: 17,027 location comparisons against the previous parser, including ports, route groups, malformed prefixes, and Unicode line separators.
Verify per-parser reuse/isolation, fresh public frames, live changes to source names/contents/mappings/ignore sets, and first duplicate behavior.
Reproduced the ignored-candidate regression against the old implementation: 1,001 name reads instead of three; the optimized implementation passes.
pnpm test:conformance: 1,857 passed, two existing skips; typechecks, production build, and four packaged modes passed. An earlier full run hit an existing React 16.0 subprocess test timeout under load; the complete rerun passed without changing its timeout.
pnpm check: zero errors, two existing E2E warnings.
Upstream verification: eight source hashes and 12 direct ports.
Current expanded built smoke matrix passed, covering all 65 callable exports. All 72 typed useFiber worker configurations passed across nine React fixtures and both formats. Added a regression for flushing the report and terminating despite early React scheduler MessagePorts.
Paired source/inspection benchmarks passed before the benchmark-quality refactor.
Completed the full benchmark again at 3a89258: 792 verified result rows, covering all 65 callable exports, with the typed workers, all 128 distinct call sites, and incremental journaling. Exit status 0; results saved under benchmarks/results/run-9kgLiO/ and latest.*.
Unit coverage rerun after the benchmark-quality refactor passed (947 tests, two existing skips): 92.87% statements, 88.90% branches, 91.60% functions, 94.53% lines. The updated stack parser has 100% statement/line/function coverage and 98.73% branch coverage.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Pushed benchmark-quality fixes in 16c82ff and 3a89258, plus the requested getSource README simplification in f1effd0. Full conformance: 1,857 passed / two existing skips; all four packaged modes passed. Full benchmark at 3a89258: 792 verified rows, all 65 callable exports, exit 0. Core CI, web E2E, Android E2E, and review passed. Retrying only the failed iOS job: Detox exited with proper-lockfile ECOMPROMISED (Unable to update lock within the stale threshold), before any test assertion failure. Unrelated kitchen-sink work remains uncommitted and excluded.
Validation complete: the iOS retry passed without code or assertion changes. All current PR checks are green, including web, Android, iOS, build, check, typecheck, test, and review. Local full benchmark: 792 verified rows / all 65 callable exports. Local conformance: 1,857 passed, two existing skips. Coverage rerun passed at 92.87% statements / 88.90% branches. All intended changes are pushed; unrelated kitchen-sink work remains excluded.
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
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.
Stack
Depends on #112 (base:
perf/benchmark-public-api), which is stacked on #111.Changes
parseStackresults remain fresh.getSourcedescription as requested.No public export changes or changes to
useFibercapture. Unrelated kitchen-sink work remains excluded.Paired performance results
Historical production bundles before (
35fe6a6) versus after, using identical expanded fixtures on local Node 24.20.0 / Apple M5 Max. The later typed-worker refactor changes fixture stack layout; these measurements are not comparisons across that refactor. Timings are diagnostic, not browser/mobile guarantees.Native Error capture and Node's source-map-aware stack formatting remain substantial costs. Inspection still replays user code; reverse lookups and deep ancestor walks remain linear. Machine-load variation was visible in other runs, so these are not timing thresholds.
Correctness and validation
pnpm test:conformance: 1,857 passed, two existing skips; typechecks, production build, and four packaged modes passed. An earlier full run hit an existing React 16.0 subprocess test timeout under load; the complete rerun passed without changing its timeout.pnpm check: zero errors, two existing E2E warnings.useFiberworker configurations passed across nine React fixtures and both formats. Added a regression for flushing the report and terminating despite early React scheduler MessagePorts.3a89258: 792 verified result rows, covering all 65 callable exports, with the typed workers, all 128 distinct call sites, and incremental journaling. Exit status 0; results saved underbenchmarks/results/run-9kgLiO/andlatest.*.