7 Commits

Author SHA1 Message Date
Aiden Bai 922616f08d perf: keep TypeScript, git, and worker boot off the scan's critical path (#1803)
Seventeen measured, byte-identical speedups: pool-aware batch planning, interned sidecar probes shared with idle workers, one sized source listing, plugin pre-import at worker boot, oxc raw transfer for cross-file parses (JSON fallback on Windows), concurrent cache-identity git calls, lazy conf/prompts/agent-install/TypeScript, a scan preamble that starts git, the oxlint workers and a React Compiler detection worker before the CLI bundle evaluates, JSONC tsconfig parsing, and a text gate on the auto-import config parse. ant-design lint: no-cache -20%, cold -45%, hot -37%; stress project: -26% / -16% / -17%. Parity over 14 repositories: 0 added, 0 removed.
2026-09-13 23:44:28 +08:00
Aiden Bai dfcde1035a perf: persistent oxlint worker pool, parent-side overlap, and plugin hot-path cuts (2.4–5.5x on the large-repo corpus) (#1781) 2026-09-09 22:59:45 +08:00
Aiden Bai 2b0f06ec70 perf: profile and optimize rule execution (#1663) 2026-08-20 22:05:20 -07:00
Aiden Bai 8c2f03aea9 feat: make React cleanup first-class (#1624)
* feat: make React cleanup first-class

* refactor: remove editor integrations

* fix: harden React cleanup analysis

* fix: detect default export duplication roots

* fix: unwrap typed duplication roots

* feat: add opt-in project analysis rules

* fix: canonicalize project analysis paths

* fix: harden project analysis precision

* fix: recognize cross-platform project entries

* fix: eliminate project analysis false positives

* fix: harden project analysis reachability

* fix: canonicalize project analysis inputs

* fix: resolve project analysis review findings

* fix: eliminate residual project analysis false positives

* fix: ignore commented registry previews

* fix: eliminate project analysis false positives

* fix: normalize project analysis paths across platforms

* fix: normalize Nextra theme path identity

* test: canonicalize convention fixture paths

* fix: preserve project analysis provenance

* fix: harden project analysis precision

* fix: honor project analysis boundaries

* fix: recognize conditional config plugins

* fix: recognize executable project references

* fix: recognize Stencil tool contracts

* fix: recognize nested tool references

* fix: recognize project setup contracts

* fix: recognize generated and local package consumers

* fix: recognize static template package references

* fix: recognize nested package runtime contracts

* fix: close project analysis parser gaps

* fix: parse project conventions structurally

* refactor: replace structural scanners with parsers

* fix: recognize functional Next CSS config

* fix: close remaining project analysis gaps

* fix: apply tag filters to project analysis

* fix: preserve embedded source positions

* fix: validate static config helper bindings

* fix: bound runtime directory discovery

* fix: close final dependency analysis gaps

* fix: preserve declaration dependency references

* chore: refresh generated rule metadata

* fix: make project analysis portable and bounded

* test: stabilize cleanup scaling guard

* refactor: parse project syntax with oxc

* fix: normalize native filesystem paths

* fix: separate path identity from report paths

* fix: match project files by filesystem identity

* fix: match build glob files by package identity

* fix: use native path keys for file identity

* fix: canonicalize Windows file identities

* fix: canonicalize package ownership paths

* test: inspect Windows path identities

* test: trace Windows package ownership

* fix: keep Windows path identities consistent

* fix: classify test contracts by normalized path

* fix: scope test contracts by canonical package path

* fix: keep test package graphs conservative

* test: keep React complexity advisory
2026-08-13 16:26:08 -07:00
Aiden Bai 13138a4af5 refactor: simplify internals across the workspace (#1590) 2026-08-08 00:20:14 -07:00
Aiden Bai 1d01dd33d1 fix(ci): stabilize matrix-sensitive tests 2026-07-31 02:18:32 +00:00
Aiden Bai 76cd6bea69 perf: reduce cold scan startup and add V8 profiling (#1114)
* perf: reduce cold scan startup and add V8 profiling

Add repeatable CPU and heap profiling so cold-run bottlenecks can be measured, then remove profile-proven startup, traversal, and security-scan overhead.

* perf: add deterministic stress benchmark

Exercise cold scans with reproducible diagnostics and remove redundant visitor-map allocations so regressions are measurable and behavior stays hash-verifiable.

* fix(tests): normalize benchmark paths cross-platform

Resolve the absolute fixture path through Node so the harness expectation matches Windows path semantics.

* perf: avoid effect analysis parent traversal

Reuse Oxc visitor keys with a parent-safe fallback so effect scope analysis no longer strips and restores every AST parent reference.

* perf: reduce repeated semantic traversal

Reuse host visitors and shared analysis caches to avoid redundant cold-scan AST passes while preserving diagnostic parity.

* fix: harden performance regression coverage

* fix(perf): support profiling on Node 20

* fix(plugin): skip CFGs for bodyless functions

* fix: harden profiling and semantic compatibility

Prevent benchmark artifacts and host differences from corrupting comparisons, while preserving host AST and React Compiler compatibility across optimized scan paths.

* fix(plugin): preserve rule correctness in fast scan paths

Keep security prefilters comment-tolerant and resolve React HOC wrappers by binding provenance so scan optimizations cannot hide valid diagnostics.

* fix: address review findings and consolidate duplicated code

- wrapWithSemanticContext copies the rule's visitors instead of mutating
  a possibly shared object; walkAst regains its null-root guard
- no-multi-comp HOC identity accepts React-compat runtimes via
  REACT_RUNTIME_MODULE_SOURCES (now incl. @wordpress/element) across
  ESM, require(), and TS import-equals, with regression coverage in
  both directions
- shared traversal core (forEachChildNode) replaces the walkChildren and
  containsJsx copies; isImportedFromReact deduped into is-react-api-call
- performance harness consolidated (27 -> 22 files): shared commander
  options, shared profile-frame accumulation, record shape guards, dead
  BenchmarkSample.profileDirectory removed
- CLI-spawning harness tests skip without a built dist; dead and
  tautological test assertions removed

Net -282 LOC against the branch head.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(plugin): capture the Program root for every rule

Rules can reach context.scopes through shared helpers and factories
(createDeprecatedReactImportRule resolves namespace aliases via
resolveConstIdentifierAlias), so the codegen'd requiresSemanticContext
flag — a regex over the rule's own file — silently left factory-based
rules on stub scope analyses: no-react-dom-deprecated-apis and
no-react19-deprecated-apis stopped reporting namespace usages through
the host wrapper.

Delete the flag and its regex detector entirely and install the
root-capture Program visitor on every rule. The analyses stay lazy and
memoized per Program, so rules that never read them still pay only one
call per rule per file, and no future helper-routed consumer can be
missed. Regression test runs the real host-wrapped rule and fails
against the gated wrapper.

Fixes cursor bugbot review finding on PR #1114.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(scripts): reject cyclic heap-profile node graphs during collection

collectNodes flattened the parsed tree with no visited guard, so a
cyclic or shared-node object graph would loop before reaching the
duplicate-ID check. Unreachable through analyzeHeapProfiles (JSON.parse
output is always a strict tree), but guard and throw like the CPU
analyzer so a synthetic graph fails deterministically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Rayhan Noufal Arayilakath <me@rayhanadev.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 21:40:52 -04:00