Files
Donny/강동윤andGitHub 9c048d1571 perf(es/parser): optimize underscore stripping in numeric literal hot path (#11670)
## Summary
- optimize numeric-separator stripping in `swc_ecma_parser` lexer hot
path by replacing `chars()` filtering with byte-level filtering
- keep fast path behavior (`Cow::Borrowed`) when no underscore is
present
- add a focused lexer benchmark case for underscore-heavy numeric
literals
- add parser regression fixture coverage for issue `#11649`

## Changes
- `crates/swc_ecma_parser/src/lexer/mod.rs`
- rewrote `remove_underscore` to process bytes and build the stripped
string without UTF-8 char iteration
- `crates/swc_ecma_parser/benches/files/numeric-separators.js`
  - added a numeric-separator-heavy benchmark corpus
- `crates/swc_ecma_parser/benches/lexer.rs`
  - added `es/lexer/numeric-separators` benchmark entry
- `crates/swc_ecma_parser/tests/js/issue-11649/input.js`
- `crates/swc_ecma_parser/tests/js/issue-11649/input.js.json`

## Verification
- `git submodule update --init --recursive`
- `UPDATE=1 cargo test -p swc_ecma_parser --test js issue_11649 --
--ignored`
- `cargo test -p swc_ecma_parser --test js issue_11649 -- --ignored`
- `cargo test -p swc_ecma_parser --test js issue_10724 -- --ignored`
- `cargo test -p swc_ecma_parser`
- `cargo bench -p swc_ecma_parser --bench lexer -- numeric-separators`
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`

Fixes #11649
2026-03-13 09:07:47 +09:00
..