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

make os_version a Cow as it's only heap allocated sometimes #10

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

pjenvey
Copy link
Contributor

@pjenvey pjenvey commented Apr 24, 2018

Hey @hhatto,

I played around w/ making os_version a Cow since it's usually a &'a str and only sometimes a String. I don't see any wins in cargo bench but admittedly I haven't looked at these benchmarks, I don't know if they execute any paths that would show differences.

I suspect this change isn't even worth making: it's probably a negligible win if anything, and maybe even a wash as Cow may introduce some dispatch overhead on its own (being an enum).

I figured I'd bring it here for you if you have the time to look into it further (unfortunately I don't) and find any worth to it, otherwise feel free to reject this PR as a failed experiment =]

Verified

This commit was signed with the committer’s verified signature.
pjenvey Philip Jenvey
@hhatto
Copy link
Member

hhatto commented Jun 26, 2018

@pjenvey

Sorry for late reply.
Looks Good To Me 👍
I will merge this change.

Thanks

@hhatto hhatto merged commit 6a66c56 into woothee:master Jun 26, 2018
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