cespare / mph

Minimal perfect hashing in Go
MIT License
72 stars 11 forks source link

Performance improvements #4

Open SaveTheRbtz opened 1 year ago

SaveTheRbtz commented 1 year ago

In this PR:

name          time/op
Murmur/1-8      2.68ns ± 1%
Murmur/4-8      3.45ns ± 1%
Murmur/8-8      4.70ns ± 0%
Murmur/16-8     6.19ns ± 0%
Murmur/32-8     10.6ns ± 0%
Murmur/50-8     16.3ns ± 2%
Murmur/500-8     202ns ± 0%
XXH3/1-8        2.53ns ± 2%
XXH3/4-8        2.51ns ± 2%
XXH3/8-8        2.45ns ± 1%
XXH3/16-8       2.35ns ± 1%
XXH3/32-8       3.16ns ± 0%
XXH3/50-8       4.87ns ± 5%
XXH3/500-8      38.6ns ± 1%

name old alloc/op new alloc/op delta Build 32.7MB ± 0% 32.7MB ± 0% +0.02% (p=0.000 n=7+9) Table 0.00B 0.00B ~ (all equal) TableMap 0.00B 0.00B ~ (all equal)

name old allocs/op new allocs/op delta Build 302k ± 0% 302k ± 0% +0.07% (p=0.000 n=10+10) Table 0.00 0.00 ~ (all equal) TableMap 0.00 0.00 ~ (all equal)



Ref: https://github.com/cespare/mph/issues/3