Repository navigation
Conversation
Contributor
Author
|
This is JS-only performance work, so I’m withdrawing it following the reference-runtime policy in #1644. |
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 #1612.
Counting a String no longer expands it into a character array or converts its non-scalar Chars at a text edge. The loop walks the existing internal Char widths; the head/tail decoder now accepts an offset, and both existing call sites pass zero. Extra counting storage changes from O(n) to O(1).
I compiled the same Bend program returning two million emoji, then measured three fresh Bun processes per build with
/usr/bin/time -f %M. Every run printed2000000. These are whole-process peak RSS medians, not an allocation-profiler estimate:The mixed ASCII/astral/arbitrary-U32 regression,
string_kit,char_any_codeandstring_unicodeall pass on Bun and native C. Repo gate: 54/54.Based on
7e120d5; compiler size is 63,618 → 63,696 (+78). I left this draft alongside #1606/#1610 while main remains at 64,092 against the permanent 64,000 cap. No cap changes, comment trimming or new dependencies.Linux x86-64, Bun 1.4.3, clang 22.1.8; the mini-cluster/Metal/CUDA gates were not run here. AI-assisted patch.