]> Cypherpunks repositories - gostls13.git/commit
net: use bytes.Equal instead of bytesEqual
authorErik Dubbelboer <erik@dubbelboer.com>
Thu, 9 Feb 2017 04:54:25 +0000 (12:54 +0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 13 Feb 2017 03:45:47 +0000 (03:45 +0000)
commit39fcf8bf0e3a3b447780983c1f88df5bb9f5bc98
tree7f484e61ef923bc25a3cebac1bf6be547018f94a
parent61bf0d1c4033ef2cc6905c2ca6e03046cf54d2bc
net: use bytes.Equal instead of bytesEqual

bytes.Equal is written in assembly and is slightly faster than the
current Go bytesEqual from the net package.

benchcmp:
benchmark                 old ns/op     new ns/op     delta
BenchmarkIPCompare4-8     7.74          7.01          -9.43%
BenchmarkIPCompare6-8     8.47          6.86          -19.01%

Change-Id: I2a7ad35867489b46f0943aef5776a2fe1b46e2df
Reviewed-on: https://go-review.googlesource.com/36850
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/ip.go
src/net/ip_test.go