Skip to content

perf: 1-file incremental rebuild regresses +79-81% (117ms -> ~209ms), likely from PR #1840 structure-metrics recompute #1855

Description

@carlos-alm

The "Pre-publish benchmark gate" CI job (tests/benchmarks/regression-guard.test.ts) is failing on both PR #1841 and PR #1843 with an identical regression signature:

[native] 1-file rebuild: 117 -> 209-212ms (+79-81%, threshold 15-50%)
[wasm]   1-file rebuild: 112-113 -> 201-203ms (+79-81%, threshold 15-75%)

Both PRs are stacked on top of PR #1840 ("fix: recompute directory structure metrics for affected directories on incremental rebuild", branch fix/issue-1738-structure-metrics-incremental-stale). Neither #1841 (maxBuffer DEFAULTS refactor) nor #1843 (blast-radius check gating) touch incremental-build or structure-metrics code in their own diffs — the regression is present identically on both, which points to it being inherited from an earlier commit in the stack.

PR #1840's change adds a recompute of directory structure metrics for affected directories on every incremental rebuild. That is a very plausible root cause for a ~80% slowdown specifically isolated to the "1-file rebuild" incremental benchmark tier (full builds and other tiers are unaffected per the regression-guard output).

Ask: Investigate whether PR #1840's incremental structure-metrics recompute is the source of this regression (e.g. recomputing metrics for more directories than necessary, or recomputing unconditionally instead of only when the affected directory's contents changed), and fix at the root cause or add a KNOWN_REGRESSIONS entry with justification if the added work is genuinely necessary and the new baseline is acceptable.

Discovered while sweeping PR #1843 for merge-readiness — deferred because the regression is not part of #1843's own diff scope (git diff origin/fix/issue-1739-maxbuffer-defaults...HEAD --stat for #1843 only touches src/features/check.ts, src/cli/commands/check.ts, tests/integration/check.test.ts, and two SKILL.md docs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions