Repository navigation
Merged
Conversation
mathiasrw
marked this pull request as draft
October 23, 2026 13:05
mathiasrw
marked this pull request as ready for review
October 23, 2026 13:15
mathiasrw
added this pull request to stack #841
October 23, 2026 13:56
…nd never crash on it
…thout a conflict
mathiasrw
marked this pull request as draft
October 23, 2026 14:58
mathiasrw
marked this pull request as ready for review
October 23, 2026 15:02
mathiasrw
removed this pull request from stack #841
October 23, 2026 15:57
mathiasrw
added this pull request to stack #849
October 23, 2026 16:12
mathiasrw
marked this pull request as draft
October 23, 2026 16:12
mathiasrw
removed this pull request from stack #849
October 23, 2026 16:12
mathiasrw
marked this pull request as ready for review
October 23, 2026 16:15
mathiasrw
added this pull request to stack #850
October 23, 2026 16:17
mathiasrw
marked this pull request as draft
October 23, 2026 16:22
…for $i without a search of their own
mathiasrw
marked this pull request as ready for review
October 23, 2026 16:29
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.
Closes #814
Stacked on #829.
Change
The numbers of #791 cost time also in runs that do not use them:
--jscode now only makes the numbers the code uses. Before, about 120 variables were made for each match when the code ran once per match.$iand$c. A file counts for$iwhen the code runs for a match in it, and for$cwhen its content changed, both known as the file is worked on. Before, every file was searched again in every run, also without--js.rexreplace '(foo)' '$1.toUpperCase()' m.txt --js -owith 20,000 matches, Bun on a Mac:$MTests
yarn test-cipasses, and the tests of #791 still pass. There is no new test of the speed, as it would be flaky in CI.From the review of 23 October.
After the review of 24 October
--jssays that a number is only made when the code names it, so a name built when the code runs, likeeval('$' + 'n'), is not there.Follow-up
The
--jshelp says it shorter, and the sentence on once per match is folded into it: "For speed, only the numbers the code names are made, and the code runs once per file unless it names the match, a group,$mor$M. This is found with a simple text search, so it can be fooled, like byeval('$' + 'n')." The README line is in #838.Follow-up
All the numbers are made every time, as values of the function that runs the code, and not as
varcode put in front of it. So they cost nothing to compile:(foo)$1.toUpperCase()$iis counted when the code runs for a match in the file, so there is no extra search of each file.The help says only: "For speed, the code runs once per file unless it names the match, a group,
$mor$M."test/fix/814.test.jsis new: a file with no match is skipped by$iand$c.