Skip to content

Allocate at most one empty string on binary:split/3#11066

Open
josevalim wants to merge 1 commit into
erlang:masterfrom
josevalim:jv-optimize-empty-strings-on-split
Open

Allocate at most one empty string on binary:split/3#11066
josevalim wants to merge 1 commit into
erlang:masterfrom
josevalim:jv-optimize-empty-strings-on-split

Conversation

@josevalim
Copy link
Copy Markdown
Contributor

When splitting on a binary which may allocate several empty strings,
we end-up allocating too many copies, and I thought it would be cheap
and easy to optimise for this particular case.

@josevalim
Copy link
Copy Markdown
Contributor Author

I also wonder if it would make sense to introduce <<"">> as a global constant but that's a separate discussion.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

CT Test Results

    4 files    225 suites   1h 55m 43s ⏱️
3 831 tests 3 728 ✅ 103 💤 0 ❌
4 915 runs  4 789 ✅ 126 💤 0 ❌

Results for commit e8bb33a.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@jhogberg jhogberg added the team:VM Assigned to OTP team VM label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants