nu7hatch / gouuid

Go binding for libuuid
MIT License
417 stars 160 forks source link

Optimize String method #23

Open kostyantyn opened 9 years ago

kostyantyn commented 9 years ago

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 commented 9 years ago

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

aviz commented 8 years ago

Any reason why this is not marged for so long ?