Repository navigation
Conversation
Collaborator
|
Thanks for the careful work and the measurements. We're closing this one: the JS backend is Bend's reference runtime, and we don't want ad-hoc performance special cases there. Performance work belongs on the C side. #1628's boundary walk is the behavior we want to keep in JS. Separately, guide/GUIDE.md is written by hand. Please leave it out of PRs, including rewording to make room for new lines. |
Contributor
Author
|
Got it — I’ll leave GUIDE.md alone and keep performance changes on the C side. Thanks for spelling that out. |
This was referenced Oct 19, 2026
This was referenced Oct 19, 2026
This was referenced Oct 19, 2026
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.
Fixes #1637.
Keep #1628's boundary walk when a haystack contains U+DC00. Otherwise native substring search is safe: there cannot be a match inside a packed U32 Char. An astral pair containing U+DC00 conservatively keeps the existing path.
Measured through an actual exported Bend function on Bun 1.3.13/Linux, rejecting a 1024-character almost-match in one million ASCII characters:
String.containsAdded consumer regressions for ordinary text, empty patterns, astral characters, a match inside a packed payload, a false UTF-16 match across an astral boundary, and a genuine match after a packed Char. Generated C and JS print all seven expected answers. Repository gate: 54/54. Mini-cluster/Metal/CUDA not run. AI-assisted.