-
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(linter/numeric-separators-style): replace regex with number pars…
…er (#6546) Building the Regex here is slow. We can take advantage of the fact that we know what the inputs should look like and parse the number directly. Cumulatively, this makes linting the RadixUIAdoptionSection.tsx ~7% faster: ``` hyperfine --warmup 100 --shell=none --runs 3000 './oxlint-main -W all --silent ./RadixUIAdoptionSection.jsx' './oxlint-num-separators -W all --silent ./RadixUIAdoptionSection.jsx' Benchmark 1: ./oxlint-main -W all --silent ./RadixUIAdoptionSection.jsx Benchmark 1: ./oxlint-main -W all --silent ./RadixUIAdoptionSection.jsx Time (mean ± σ): 4.1 ms ± 0.1 ms [User: 1.8 ms, System: 1.4 ms] Range (min … max): 3.8 ms … 4.7 ms 3000 runs Benchmark 2: ./oxlint-num-separators -W all --silent ./RadixUIAdoptionSection.jsx Time (mean ± σ): 3.8 ms ± 0.1 ms [User: 1.5 ms, System: 1.4 ms] Range (min … max): 3.5 ms … 4.5 ms 3000 runs Summary ./oxlint-num-separators -W all --silent ./RadixUIAdoptionSection.jsx ran 1.08 ± 0.05 times faster than ./oxlint-main -W all --silent ./RadixUIAdoptionSection.jsx ```
- Loading branch information
Showing
1 changed file
with
108 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters