mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
Profiling has shown this rule to be a consistent slow point, and in particular, the Regex construction is slow. <img width="1323" alt="Screenshot 2024-09-23 at 7 12 58 PM" src="https://github.com/user-attachments/assets/1d9b367d-eeda-4b19-b0a3-463e54ac4334"> This PR improves the situation in two ways: 1. A `Regex` is only constructed when there is a custom comment pattern (which is likely the minority of cases) 2. For the default comment pattern (when no custom pattern is passed), we now use a simple string matcher function, instead of a full-blown regex matcher. I believe this should be faster since it involves much less work, though can still allocate a `String`. |
||
|---|---|---|
| .. | ||
| examples | ||
| fixtures | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| CHANGELOG.md | ||