Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7a764d7acc545eff4dcd690bbf1ae75c64a67796
https://github.com/WebKit/WebKit/commit/7a764d7acc545eff4dcd690bbf1ae75c64a67796
Author: Sosuke Suzuki <[email protected]>
Date: 2026-07-08 (Wed, 08 Jul 2026)
Changed paths:
A JSTests/microbenchmarks/regexp-quantified-class-boyer-moore.js
A JSTests/stress/regexp-boyer-moore-counted-quantifier.js
M Source/JavaScriptCore/yarr/YarrJIT.cpp
Log Message:
-----------
[JSC] Yarr should collect BM info for fixed-count terms
https://bugs.webkit.org/show_bug.cgi?id=318665
Reviewed by Yusuke Suzuki.
collectBoyerMooreInfoFromTerm bails out on any term with
quantityMaxCount != 1, so patterns spelled with counted quantifiers
like /\b\d{3}-\d{2}-\d{4}\b/ never get the unanchored fast-skip loop
while the identical manual expansion /\d\d\d-\d\d-\d\d\d\d/ does,
making the common spelling ~10x slower on non-matching subjects.
Handle fixed-count CharacterClass and PatternCharacter terms by adding
the character set at each of the quantityMaxCount consecutive
positions. The expansion is capped by the BoyerMooreInfo length, and
greedy terms keep the previous behavior.
regexp-quantified-class-boyer-moore 69.7101+-1.0631 ^
6.4635+-0.1791 ^ definitely 10.7851x faster
Tests: JSTests/microbenchmarks/regexp-quantified-class-boyer-moore.js
JSTests/stress/regexp-boyer-moore-counted-quantifier.js
* JSTests/microbenchmarks/regexp-quantified-class-boyer-moore.js: Added.
(test):
* JSTests/stress/regexp-boyer-moore-counted-quantifier.js: Added.
(shouldBe):
(slide):
(never):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
Canonical link: https://commits.webkit.org/316790@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications