Descriptionruntime: cache most immediately-computed hash value
Proof of concept. NOT FOR SUBMISSION.
Not enough benchmarks, but to show that it's working on string
keys at least, and slowing things down when it's not triggering.
benchmark old ns/op new ns/op delta
BenchmarkNewEmptyMap 144 142 -1.39%
BenchmarkHashStringSpeed 42 46 +10.21%
BenchmarkHashInt32Speed 34 31 -8.45%
BenchmarkHashInt64Speed 31 32 +2.52%
BenchmarkHashStringArraySpeed 112 126 +12.50%
BenchmarkMegMap 298981 28 -99.99%
BenchmarkMegOneMap 24 24 +0.40%
BenchmarkMegEmptyMap 4 4 +0.44%
BenchmarkSmallStrMap 23 23 +0.00%
BenchmarkIntMap 17 17 +0.56%
BenchmarkRepeatedLookupStrMapKey32 45 35 -20.22%
BenchmarkRepeatedLookupStrMapKey1M 306886 154843 -49.54%
For Issue 5147
Patch Set 1 #Patch Set 2 : diff -r 8f36f2ef721b https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 8f36f2ef721b https://go.googlecode.com/hg/ #
Total comments: 4
Patch Set 4 : diff -r a3717460e37c https://go.googlecode.com/hg/ #
MessagesTotal messages: 2
|