Skip to content

perf(native): ~2 second flat overhead added to rebuild operations in v3.10.0 #1054

@carlos-alm

Description

@carlos-alm

Summary

The v3.10.0 pre-publish benchmark gate detected a catastrophic native-engine regression on rebuild operations. A flat ~2 second overhead was added to every rebuild on the native engine. The publish was correctly blocked from npm by the regression guard (failed run).

Regression deltas (v3.10.0 vs v3.9.6, native engine, 25% threshold)

Build benchmark:

  • No-op rebuild: 13ms → 2125ms (+16246%)
  • 1-file rebuild: 78ms → 2143ms (+2647%)

Incremental benchmark:

  • No-op rebuild: 10ms → 2081ms (+20710%)
  • 1-file rebuild: 54ms → 2139ms (+3861%)

WASM engine was unaffected on the same run, so this is native-path-specific.

Pattern

A flat ~2080ms overhead is added regardless of how much work the rebuild has to do (no-op vs 1-file produce nearly identical absolute times). This is the signature of something being initialized or loaded per call that previously persisted across calls — not a slowdown in rebuild logic itself.

Important context

The benchmark CI built v3.10.0 source against the v3.9.6 native binary (the published artifact). Logs show:

[codegraph] Using native engine (v3.9.6)

That means the regression is on the JavaScript/TypeScript wrapper around native, not in the Rust extractor crate.

Suspected causes (PRs between v3.9.6 and v3.10.0)

Reproduction

git checkout v3.10.0
npm install
npm run build
node --import ./scripts/ts-resolve-loader.js scripts/build-benchmark.ts --version 3.10.0
node --import ./scripts/ts-resolve-loader.js scripts/incremental-benchmark.ts --version 3.10.0

Compare `native.noopRebuildMs` and `native.oneFileRebuildMs` to the v3.9.6 baseline in `generated/benchmarks/{BUILD,INCREMENTAL}-BENCHMARKS.md`.

Acceptance criteria

  • Native no-op rebuild back to <50ms (was 10–13ms in v3.9.6)
  • Native 1-file rebuild back to <100ms (was 54–78ms in v3.9.6)
  • `npm run test:regression-guard` passes against the v3.9.6 baseline
  • Pre-publish benchmark gate clears for the next release attempt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions