neoneo-go/pkg/crypto
Roman Khimov 217d7bdf44 keys: add equality benchmark
Go 1.15 provides native (*ecdsa.PublicKey).Equal method, but we can't drop our
own Equal because the types are different and there is still code using our
Equal (forcing it to convert types is counterproductive), while changing
(*PublicKey).Equal to use (*ecdsa.PublicKey).Equal internally with some kind of

  (*ecdsa.PublicKey)(p).Equal((*ecdsa.PublicKey)(key))

slows it down:

name           old time/op    new time/op    delta
PublicEqual-8    14.9ns ± 1%    18.4ns ± 2%  +23.55%  (p=0.000 n=9+10)

name           old alloc/op   new alloc/op   delta
PublicEqual-8     0.00B          0.00B          ~     (all equal)

name           old allocs/op  new allocs/op  delta
PublicEqual-8      0.00           0.00          ~     (all equal)

So leave it as is, but add this micro-bench. Refs. #1319.
2021-08-25 15:18:26 +03:00
..
hash hash: suppress staticcheck warning 2021-05-12 22:52:32 +03:00
keys keys: add equality benchmark 2021-08-25 15:18:26 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
verifiable.go crypto: add Hashable to VerifiableDecodable 2021-03-26 13:45:18 +03:00