Improve boundary classification#17005
Merged
Merged
Conversation
This is a relatively small change, but with big impact: ```diff - CandidateMachine: Throughput: 308.62 MB/s + CandidateMachine: Throughput: 324.34 MB/s ``` Almost 20 MB/s more throughput from this change alone.
We still need it for `%w{…}` in Ruby land, but let's solve that using
the pre processor instead.
797ef23 to
b3c597b
Compare
thecrypticace
approved these changes
Mar 6, 2025
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
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.
This PR cleans up the boundary character checking by using similar classification techniques as we used for other classification problems.
For starters, this moves the boundary related items to its own file, next we setup the classification enum.
Last but not least, we removed
}as an after boundary character, and instead handle that situation in the Ruby pre processor where we need it. This means the%w{flex}will still work in Ruby files.This PR is a followup for #17001, the main goal is to clean up some of the boundary character checking code. The other big improvement is performance. Changing the boundary character checking to use a classification instead results in:
Took the best score of 10 runs each:
So a ~20MB/s improvement.
Test plan
}as an after boundary character, some tests are updated.