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

Remove allocations in Markup by switching to Cow<'static, str> #585

Merged
merged 5 commits into from
Sep 29, 2024

Conversation

rben01
Copy link
Contributor

@rben01 rben01 commented Sep 28, 2024

Now strings are only allocated if non-static. (The vast majority of markup strings are &'static.)

There is of course a cost associated with this, the cost of checking the Cow variant, but given the number of static strings in use for markup, there's no way that this is a greater cost than allocating those as strings.

Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@sharkdp sharkdp merged commit f3fba19 into sharkdp:master Sep 29, 2024
15 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.

2 participants