mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
Improves performance of this rule by replacing `Regex` with simpler string methods. On the `RadixUIAdoptionSection.jsx` file alone, this improves performance by ~5%:
```
hyperfine --warmup 100 --shell=none --runs 3000 './oxlint-main -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx' './oxlint-jsx-no-comment-textnodes-no-regex -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx'
Benchmark 1: ./oxlint-main -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx
Time (mean ± σ): 4.4 ms ± 0.1 ms [User: 1.7 ms, System: 1.9 ms]
Range (min … max): 4.1 ms … 5.3 ms 3000 runs
Benchmark 2: ./oxlint-jsx-no-comment-textnodes-no-regex -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx
Time (mean ± σ): 4.2 ms ± 0.1 ms [User: 1.5 ms, System: 1.8 ms]
Range (min … max): 3.9 ms … 5.0 ms 3000 runs
Summary
./oxlint-jsx-no-comment-textnodes-no-regex -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx ran
1.06 ± 0.05 times faster than ./oxlint-main -W jsx-no-comment-textnodes --silent ./RadixUIAdoptionSection.jsx
```
|
||
|---|---|---|
| .. | ||
| oxc | ||
| oxc_allocator | ||
| oxc_ast | ||
| oxc_ast_macros | ||
| oxc_cfg | ||
| oxc_codegen | ||
| oxc_data_structures | ||
| oxc_diagnostics | ||
| oxc_ecmascript | ||
| oxc_index | ||
| oxc_isolated_declarations | ||
| oxc_language_server | ||
| oxc_linter | ||
| oxc_macros | ||
| oxc_mangler | ||
| oxc_minifier | ||
| oxc_module_lexer | ||
| oxc_parser | ||
| oxc_prettier | ||
| oxc_regular_expression | ||
| oxc_semantic | ||
| oxc_sourcemap | ||
| oxc_span | ||
| oxc_syntax | ||
| oxc_transformer | ||
| oxc_traverse | ||
| oxc_wasm | ||