mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Whole-pattern ignore-case literals already bypass the VM, but the search path still checked every start position linearly with full case-fold comparisons. For ASCII literals we can cheaply scan for the first code unit and only verify the rest at candidate positions. This keeps the existing non-ASCII fallback intact while speeding up common benchmark shapes such as `/puebzr/i`, `/zfvr/gi`, and `/##yv22##/gi`. Add tests covering both alphabetic and punctuation-led ASCII literals under ignore-case matching. TestRegex passes. In Build/release js microbenchmarks, representative cases dropped from about 47ms to 38ms, 95ms to 63ms, and 121ms to 79ms.