Skip to content

Investigate hashing methods #32

Open
@object88

Description

@object88

Current performance for Get is between 2 and 7 times slower than native implementation for maps (depending on map size). There are many possible reasons, including the performance of the hashing mechanism.

The current code uses the built-in FNV32a hash methods, as supplied in the hash package. Using the benchmark tools, we can see that...

for i := 0; i < max; i++ {
  hasher := fnv.New32a()
  binary.Write(hasher, binary.LittleEndian, uint32(i))
  hash32 = hasher.Sum32()
}

...takes about 0.02ns / op, where max is 500,000.

Although it seems that there is little to gain here, we might find some slightly better performance by using a custom hashing mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions