-
-
Notifications
You must be signed in to change notification settings - Fork 161
perf(regex): take perex 0.1.7 and lend the thread's scratch to a search (#10166) #10372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fbf57f7
deps(regex): take perex 0.1.7
2709fe7
perf(regex): lend the thread's scratch to a search instead of buildin…
faf6566
test(regex): the `v` grammar's set operators compile under perex 0.1.7
fe0a254
docs(changelog): fragment for #10372
6b9d09a
fix(regex): declare the lent scratch with perry_thread_local!
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ### Faster | ||
|
|
||
| - `RegExp` calls no longer build their match scratch per call. A `.test()` on a short string costs about a third fewer instructions, and `exec` about a quarter fewer, because the thread lends one scratch cell to each search instead of constructing and moving a fresh one (#10166). | ||
|
|
||
| ### Changed | ||
|
|
||
| - The regex engine moves from perex 0.1.4 to 0.1.7. The `v` flag is complete: string members (`[\q{abc|de}]`), the properties of strings such as `\p{RGI_Emoji}`, and set operators such as `[a--b]` all compile and match. A start-anchored pattern now tries only one start. |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 21100
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 15569
Fall back when retained scratch exceeds the current memory limit.
find_near_lentcharges the retainedLENT_SCRATCHframe and undo vectors before the search runs. An earlier search can grow those vectors, so a later smaller search can returnStorageError::Limiteven when its ownedMatchBufferswould fit.find_nearrestores the entry budget afterLent::Fallback; the owned path still reports a limit error if its actual requirements exceed the limit.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents