Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve string.replace #893

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Improve string.replace #893

merged 2 commits into from
Jun 25, 2024

Conversation

Sainan
Copy link
Member

@Sainan Sainan commented Jun 21, 2024

Made string.replace binary-safe, which saves the time of needing to measure the length of the C strings, and added a fast path for the case of max_replace == 0.

This also is a huge performance boost for this function as we were spending a lot of time measuring the length of the C strings.
@Sainan Sainan changed the title Make string.replace binary-safe Improve string.replace Jun 21, 2024
@well-in-that-case well-in-that-case merged commit e82ff93 into main Jun 25, 2024
8 checks passed
@well-in-that-case well-in-that-case deleted the replace branch June 25, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants