Repository navigation
[JSC] Add RegExpSubstringGlobalAtomCache - #34805
Merged
webkit-commit-queue merged 1 commit intoOct 8, 2024
Merged
webkit-commit-queue merged 1 commit into
webkit-commit-queue merged 1 commit into
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 5afe934) Details |
hyjorc1
force-pushed
the
eng/JSC-Add-RegExpSubstringGlobalAtomCache
branch
from
October 8, 2024 07:50
5afe934 to
405180e
Compare
Collaborator
|
EWS run on previous version of this PR (hash 405180e) Details |
hyjorc1
marked this pull request as ready for review
October 8, 2024 16:40
Constellation
approved these changes
Oct 8, 2024
Constellation
left a comment
Member
There was a problem hiding this comment.
Let's also add a link to V8 change too we get inspired from in the commit message.
hyjorc1
force-pushed
the
eng/JSC-Add-RegExpSubstringGlobalAtomCache
branch
from
October 8, 2024 22:11
405180e to
a570b8f
Compare
Collaborator
|
EWS run on current version of this PR (hash a570b8f) Details |
Contributor
Author
Done. |
https://bugs.webkit.org/show_bug.cgi?id=281012 rdar://137459855 Reviewed by Yusuke Suzuki. Inspired by [1], this update adds a caching mechanism to optimize repeated matching of global atomic regular expressions on growing substrings. By caching results, we avoid redundant work and improve performance, particularly in scenarios where the same RegExp is applied to overlapping or incrementally growing substrings. MicroBenchmark Result with `--inner 10 --outer 20`: before after substring-match-global-atom 3.1816+-0.0123 ^ 2.4063+-0.0082 ^ definitely 1.3222x faster [1] https://chromium-review.googlesource.com/c/v8/v8/+/5886727 * JSTests/microbenchmarks/substring-match-global-atom.js: Added. (test): * Source/JavaScriptCore/CMakeLists.txt: * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/Sources.txt: * Source/JavaScriptCore/runtime/JSString.h: (JSC::JSString::asRope): * Source/JavaScriptCore/runtime/RegExp.cpp: (JSC::RegExp::finishCreation): (JSC::RegExp::byteCodeCompileIfNecessary): (JSC::RegExp::compile): (JSC::RegExp::compileMatchOnly): (JSC::RegExp::deleteCode): * Source/JavaScriptCore/runtime/RegExp.h: * Source/JavaScriptCore/runtime/RegExpGlobalData.h: (JSC::RegExpGlobalData::substringGlobalAtomCache): * Source/JavaScriptCore/runtime/RegExpObject.cpp: (JSC::RegExpObject::matchGlobal): * Source/JavaScriptCore/runtime/RegExpSubstringGlobalAtomCache.cpp: Added. (JSC::RegExpSubstringGlobalAtomCache::visitAggregateImpl): (JSC::RegExpSubstringGlobalAtomCache::hasValidPattern): (JSC::RegExpSubstringGlobalAtomCache::tryGet): (JSC::RegExpSubstringGlobalAtomCache::record): (JSC::RegExpSubstringGlobalAtomCache::collectMatches): * Source/JavaScriptCore/runtime/RegExpSubstringGlobalAtomCache.h: Copied from Source/JavaScriptCore/runtime/RegExpGlobalData.h. (JSC::RegExpSubstringGlobalAtomCache::lastRegExp): * Source/JavaScriptCore/yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::extractAtom): (JSC::Yarr::YarrPattern::compile): * Source/JavaScriptCore/yarr/YarrPattern.h: Canonical link: https://commits.webkit.org/284859@main
webkit-commit-queue
force-pushed
the
eng/JSC-Add-RegExpSubstringGlobalAtomCache
branch
from
October 8, 2024 23:23
a570b8f to
4321993
Compare
Collaborator
|
Committed 284859@main (4321993): https://commits.webkit.org/284859@main Reviewed commits have been landed. Closing PR #34805 and removing active labels. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 vision
4321993
a570b8f
🛠 wpe🛠 win🧪 wpe-wk2🧪 win-tests🧪 ios-wk2🧪 api-wpe🧪 ios-wk2-wpt🛠 wpe-cairo🛠 🧪 jsc🧪 api-ios🧪 mac-AS-debug-wk2🧪 gtk-wk2🧪 api-gtk🧪 mac-intel-wk2🛠 tv-sim🛠 watch🛠 watch-sim