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

Optimize String method #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Optimize String method #23

wants to merge 1 commit into from

Conversation

kostyantyn
Copy link

New String() method is approximately 14 times faster

Benchmarks:

BenchmarkStringNew  20000000           121 ns/op          48 B/op          1 allocs/op
BenchmarkStringOld   1000000          1709 ns/op         269 B/op          9 allocs/op

New String() method is approximately 14 times faster

Benchmarks:
BenchmarkStringNew	20000000	       121 ns/op	      48 B/op	       1 allocs/op
BenchmarkStringOld	 1000000	      1709 ns/op	     269 B/op	       9 allocs/op
@kisielk
Copy link
Contributor

kisielk commented Jan 10, 2015

👍 and a 9x reduction in allocations is nice too for apps that generate a lot of UUIDs

@aviz
Copy link

aviz commented Apr 7, 2016

Any reason why this is not marged for so long ?

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