gomemcache icon indicating copy to clipboard operation
gomemcache copied to clipboard

Unsafe bytes instead of bytes pool

Open gobwas opened this issue 9 years ago • 1 comments

Hello!

I have tried to use (I think, the already well known) evil technique to avoid allocations and copying. This brings about -19ns to the benchmark of picking server:

BenchmarkPickServer-4           10000000           179 ns/op           0 B/op          0 allocs/op
BenchmarkPickServer-4           10000000           160 ns/op           0 B/op          0 allocs/op

I do not think that it is aka "must have" improvement, but I have made this to notice that there is some space to increase performance and reduce the code =)

gobwas avatar Jul 25 '16 15:07 gobwas

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

googlebot avatar Feb 08 '17 20:02 googlebot

Closing as old. Shouldn't need unsafe in this package, anyway.

bradfitz avatar Jul 02 '23 04:07 bradfitz