• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

v2/H03-May-2022-

xxhsum/H10-Sep-2018-

README.mdH A D10-Sep-20181.8 KiB

go.modH A D10-Sep-2018146

go.sumH A D10-Sep-2018402

rotate.goH A D10-Sep-2018643

rotate19.goH A D10-Sep-2018563

xxhash.goH A D10-Sep-20183.3 KiB

xxhash_amd64.goH A D10-Sep-2018206

xxhash_amd64.sH A D10-Sep-20184.1 KiB

xxhash_amd64_test.goH A D10-Sep-20181.3 KiB

xxhash_other.goH A D10-Sep-20181.5 KiB

xxhash_safe.goH A D10-Sep-2018235

xxhash_test.goH A D10-Sep-20183.3 KiB

xxhash_unsafe.goH A D10-Sep-2018906

README.md

1# xxhash
2
3[![GoDoc](https://godoc.org/github.com/cespare/xxhash?status.svg)](https://godoc.org/github.com/cespare/xxhash)
4
5xxhash is a Go implementation of the 64-bit
6[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a
7high-quality hashing algorithm that is much faster than anything in the Go
8standard library.
9
10The API is very small, taking its cue from the other hashing packages in the
11standard library:
12
13    $ go doc github.com/cespare/xxhash                                                                                                                                                                                              !
14    package xxhash // import "github.com/cespare/xxhash"
15
16    Package xxhash implements the 64-bit variant of xxHash (XXH64) as described
17    at http://cyan4973.github.io/xxHash/.
18
19    func New() hash.Hash64
20    func Sum64(b []byte) uint64
21    func Sum64String(s string) uint64
22
23This implementation provides a fast pure-Go implementation and an even faster
24assembly implementation for amd64.
25
26## Benchmarks
27
28Here are some quick benchmarks comparing the pure-Go and assembly
29implementations of Sum64 against another popular Go XXH64 implementation,
30[github.com/OneOfOne/xxhash](https://github.com/OneOfOne/xxhash):
31
32| input size | OneOfOne | cespare (purego) | cespare |
33| --- | --- | --- | --- |
34| 5 B   |  416 MB/s | 720 MB/s |  872 MB/s  |
35| 100 B | 3980 MB/s | 5013 MB/s | 5252 MB/s  |
36| 4 KB  | 12727 MB/s | 12999 MB/s | 13026 MB/s |
37| 10 MB | 9879 MB/s | 10775 MB/s | 10913 MB/s  |
38
39These numbers were generated with:
40
41```
42$ go test -benchtime 10s -bench '/OneOfOne,'
43$ go test -tags purego -benchtime 10s -bench '/xxhash,'
44$ go test -benchtime 10s -bench '/xxhash,'
45```
46
47## Projects using this package
48
49- [InfluxDB](https://github.com/influxdata/influxdb)
50- [Prometheus](https://github.com/prometheus/prometheus)
51