Skip to content
forked from cespare/mph

Minimal perfect hashing in Go

License

Notifications You must be signed in to change notification settings

SaveTheRbtz/mph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mph

Go Reference

mph is a Go package for that implements a minimal perfect hash table over strings. It uses the "Hash, displace, and compress" algorithm and the circlehash hash function.

Some quick benchmark results (Apple M1 Pro):

  • Build constructs a minimal perfect hash table from a 350k word dictionary in 100ms (construction time is linear in the size of the input).
  • Lookups on that dictionary take about 30ns and are 50% faster than a map[string]uint32:
name      time/op
Build     51.4ms ±12%
Table     13.7ns ± 0%
TableMap  42.1ns ± 1%

About

Minimal perfect hashing in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%