oxc-project
oxc
BlogDocsChangelog

fix(linter): rewrite constructor-super to use iterative dataflow analysis

#16706
Comparing
c/12-10-fix_linter_rewrite_constructor-super_to_use_iterative_dataflow_analysis
(
f45427d
) with
main
(
271e1ff
)
CodSpeed Performance Gauge
0%
Untouched
4
Skipped
41

Benchmarks

Skipped (41)

Passed

linter[cal.com.tsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
468.8 ms468.9 ms
linter[binder.ts]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
47.1 ms47.1 ms
linter[react.development.js]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
19 ms19 ms
linter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
716.1 µs718.1 µs

Commits

Click on a commit to change the comparison range
Base
main
271e1ff
-0.1%
fix(linter): rewrite constructor-super to use iterative dataflow analysis The constructor-super rule's DFS path analysis had exponential O(2^n) complexity, causing oxlint to hang indefinitely on files with complex control flow graphs (e.g., next.js compiled bundles with 59+ classes). ## Root Cause The previous algorithm explored all possible paths through the CFG, removing blocks from the visited set after each path to allow re-exploration. With k branch points, this creates 2^k paths. ## Solution Replaced the DFS path enumeration with iterative dataflow analysis: - New `SuperCallState` enum tracks abstract states: Unreached, Never, Once, Multiple, Mixed - Merge operation at CFG join points combines states from different paths - Transfer function computes state after executing super() calls - Worklist algorithm propagates states until fixpoint ## Complexity - Before: O(2^n) where n = number of branch points - After: O(n × m) where n = blocks, m = edges The state lattice has finite height (5 states), guaranteeing termination. ## Performance | File | Before | After | |------|--------|-------| | fetch.js (796KB, 59 classes) | hung indefinitely | 16ms | | load.js (800KB, 59 classes) | hung indefinitely | 50ms | | tar/index.js (98KB, 30 classes) | hung indefinitely | 6ms | | Full next.js (19,535 files) | hung indefinitely | 1.2s | 🤖 generated with help from Claude Opus 4.5
f45427d
1 day ago
by camc314
© 2025 CodSpeed Technology
Home Terms Privacy Docs