Skip to content

fix(engine): O(n²) drops slice/concat array evidence shadowed by a string - #195

Merged
yoominho91 merged 1 commit into
mainfrom
quad-string-slice
Oct 11, 2026
Merged

yoominho91 merged 1 commit into
mainfrom
quad-string-slice

Conversation

@yoominho91

Copy link
Copy Markdown
Contributor

webpack's const text = store.input.slice(...) made every text in the file an array, so string text.indexOf(...) calls counted as O(n²). Evidence from slice/concat alone is now dropped when the name is also declared without array evidence. Same-clone old vs new: 2,182 → 2,175 candidates, all 7 removed are string indexOf; no score changes (v17 kept). Fixture + FP catalog row; breaking the guard fails the fixture.

https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq

…ring

String#slice and String#concat share names with the array methods. In
webpack's syntax-parser one `const text = store.input.slice(...)` made
every `text` in the 18k-line file an array, so text.indexOf("*/", i)
string searches were counted as quadratic scans.

Evidence from only slice/concat is now dropped when the same file also
declares that name without array evidence. Same clones, old vs new
engine: 2,182 -> 2,175 candidates, all seven removed sites are string
indexOf (webpack 4, vscode 2, nocodb bundled vue 1); no score changes,
so the scoring version stays v17.

Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fixearly Building Building Preview Oct 11, 2026 8:31am UTC

@yoominho91
yoominho91 merged commit 2b6c469 into main Oct 11, 2026
3 checks passed
@yoominho91
yoominho91 deleted the quad-string-slice branch October 11, 2026 08:32

This branch was successfully deployed

1 active deployment
Preview — 2334fe5a Deployed Oct 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants