MCPcopy Index your code
hub / github.com/cespare/mph

github.com/cespare/mph @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
21 symbols 44 edges 4 files 6 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 Murmur3 hash function.

Some quick benchmark results (this is on an i7-8700K):

  • Build constructs a minimal perfect hash table from a 102k word dictionary in 18ms (construction time is linear in the size of the input).
  • Lookups on that dictionary take about 30ns and are 27% faster than a map[string]uint32:

    BenchmarkTable-12 199293806 29.99 ns/op BenchmarkTableMap-12 145449822 40.92 ns/op

Core symbols most depended-on inside this repo

hash
called by 6
murmur.go
Build
called by 3
mph.go
Lookup
called by 3
mph.go
nextPow2
called by 2
mph.go
Len
called by 0
mph.go
Less
called by 0
mph.go
Swap
called by 0
mph.go

Shape

Function 12
Method 5
Struct 2
TypeAlias 2

Languages

Go100%

Modules by API surface

mph.go9 symbols
mph_test.go8 symbols
murmur_test.go2 symbols
murmur.go2 symbols

For agents

$ claude mcp add mph \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact