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

Avoid potentially unnecessary string reallocs. #484

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

ttsugriy
Copy link
Contributor

In case dest is not created using a subset of the input dest.reserve(input.size()) would result in increasing dests size with likely reallocation. On top of being less efficient new version also generates significantly less asm with GCC 13. https://compiler-explorer.com/z/x3avEdWGM

In case `dest` is not created using a subset of the `input`
`dest.reserve(input.size())` would result in increasing `dest`s
size with likely reallocation. On top of being less efficient
new version also generates significantly less asm with GCC 13.
https://compiler-explorer.com/z/x3avEdWGM
@anonrig anonrig requested a review from lemire August 28, 2023 10:52
Copy link
Member

@lemire lemire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us merge.

@anonrig anonrig merged commit 24d3812 into ada-url:main Aug 28, 2023
28 checks passed
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.

3 participants