Skip to content

Commit 88262f4

Browse files
Use number of buckets greater than max number of keys
1 parent 79b0e4d commit 88262f4

File tree

1 file changed

+3
-2
lines changed
  • src/main/go/AlexanderYastrebov

1 file changed

+3
-2
lines changed

src/main/go/AlexanderYastrebov/calc.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ func process(data []byte) map[string]*measurement {
132132
func processChunk(data []byte) map[string]*measurement {
133133
// Use fixed size linear probe lookup table
134134
const (
135-
// use power of 2 for fast modulo calculation
136-
entriesSize = 1 << 12
135+
// use power of 2 for fast modulo calculation,
136+
// should be larger than max number of keys which is 10_000
137+
entriesSize = 1 << 14
137138

138139
// use FNV-1a hash
139140
fnv1aOffset64 = 14695981039346656037

0 commit comments

Comments
 (0)