Skip to content

Commit

Permalink
chore: clean up readme and add more current benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
felixangell committed Oct 8, 2024
1 parent bad24be commit ceeedf2
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# murmur2-go
Go implementation of MurmurHash2, based on the work by [Austin Appleby](https://code.google.com/p/smhasher/). This repo was forked to add go modules, a more modern test suite (though still lacking in rigour), and a ci pipeline to ensure build + test passes.

This is a fork of [go-murmur](https://github.com/aviddiviner/go-murmur/) with a go module specified and nothing much else.
## Usage
Specified minimum version of go is v1.22.

Go programming language implementation of MurmurHash2, based on the work by [Austin Appleby](https://code.google.com/p/smhasher/).
```bash
$ go get github.com/yarefs/murmur2-go
```

## Performance

Looks roughly something like this:

BenchmarkMurmurHash2 50000000 31.6 ns/op
BenchmarkMurmurHash2A 50000000 35.3 ns/op
BenchmarkMurmurHash64A 100000000 26.7 ns/op
BenchmarkHash32_Murmur2 10000000 197 ns/op
BenchmarkHash32_FNV1 10000000 155 ns/op
BenchmarkHash32_FNV1a 10000000 156 ns/op

## Caveats

Always test code to make sure that it works as intended. Please submit pull requests if you find anything amiss.
Benchmarked as of 2024:

```bash
➜ murmur2-go git:(main) ✗ go test -bench=. ./...
goos: darwin
goarch: amd64
pkg: github.com/yarefs/murmur2-go/murmur
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkMurmurHash2-12 61032399 19.41 ns/op
BenchmarkMurmurHash2A-12 56362617 21.29 ns/op
BenchmarkMurmurHash64A-12 81483355 14.70 ns/op
BenchmarkHash32_Murmur2-12 16060260 77.04 ns/op
BenchmarkHash32_FNV1-12 12585670 95.21 ns/op
BenchmarkHash32_FNV1a-12 12452218 95.75 ns/op
PASS
ok github.com/yarefs/murmur2-go/murmur 8.125s
```

## License

Expand Down

0 comments on commit ceeedf2

Please sign in to comment.