2
2
3
3
VENDORED: Go to [ github.com/cespare/xxhash] ( https://github.com/cespare/xxhash ) for original package.
4
4
5
-
6
- [ ![ GoDoc] ( https://godoc.org/github.com/cespare/xxhash?status.svg )] ( https://godoc.org/github.com/cespare/xxhash )
7
- [ ![ Build Status] ( https://travis-ci.org/cespare/xxhash.svg?branch=master )] ( https://travis-ci.org/cespare/xxhash )
8
-
9
- xxhash is a Go implementation of the 64-bit
10
- [ xxHash] ( http://cyan4973.github.io/xxHash/ ) algorithm, XXH64. This is a
5
+ xxhash is a Go implementation of the 64-bit [ xxHash] algorithm, XXH64. This is a
11
6
high-quality hashing algorithm that is much faster than anything in the Go
12
7
standard library.
13
8
@@ -28,31 +23,49 @@ func (*Digest) WriteString(string) (int, error)
28
23
func (*Digest) Sum64() uint64
29
24
```
30
25
31
- This implementation provides a fast pure-Go implementation and an even faster
32
- assembly implementation for amd64.
26
+ The package is written with optimized pure Go and also contains even faster
27
+ assembly implementations for amd64 and arm64. If desired, the ` purego ` build tag
28
+ opts into using the Go code even on those architectures.
29
+
30
+ [ xxHash ] : http://cyan4973.github.io/xxHash/
31
+
32
+ ## Compatibility
33
+
34
+ This package is in a module and the latest code is in version 2 of the module.
35
+ You need a version of Go with at least "minimal module compatibility" to use
36
+ github.com/cespare/xxhash/v2:
37
+
38
+ * 1.9.7+ for Go 1.9
39
+ * 1.10.3+ for Go 1.10
40
+ * Go 1.11 or later
41
+
42
+ I recommend using the latest release of Go.
33
43
34
44
## Benchmarks
35
45
36
46
Here are some quick benchmarks comparing the pure-Go and assembly
37
47
implementations of Sum64.
38
48
39
- | input size | purego | asm |
40
- | --- | --- | --- |
41
- | 5 B | 979.66 MB/s | 1291.17 MB/s |
42
- | 100 B | 7475.26 MB/s | 7973.40 MB/s |
43
- | 4 KB | 17573.46 MB/s | 17602.65 MB/s |
44
- | 10 MB | 17131.46 MB/s | 17142.16 MB/s |
49
+ | input size | purego | asm |
50
+ | ---------- | --------- | --------- |
51
+ | 4 B | 1.3 GB/s | 1.2 GB/s |
52
+ | 16 B | 2.9 GB/s | 3.5 GB/s |
53
+ | 100 B | 6.9 GB/s | 8.1 GB/s |
54
+ | 4 KB | 11.7 GB/s | 16.7 GB/s |
55
+ | 10 MB | 12.0 GB/s | 17.3 GB/s |
45
56
46
- These numbers were generated on Ubuntu 18 .04 with an Intel i7-8700K CPU using
47
- the following commands under Go 1.11 .2:
57
+ These numbers were generated on Ubuntu 20 .04 with an Intel Xeon Platinum 8252C
58
+ CPU using the following commands under Go 1.19 .2:
48
59
49
60
```
50
- $ go test -tags purego -benchtime 10s - bench '/xxhash,direct,bytes'
51
- $ go test -benchtime 10s - bench '/xxhash,direct,bytes'
61
+ benchstat <( go test -tags purego -benchtime 500ms -count 15 - bench 'Sum64$')
62
+ benchstat <( go test -benchtime 500ms -count 15 - bench 'Sum64$')
52
63
```
53
64
54
65
## Projects using this package
55
66
56
67
- [ InfluxDB] ( https://github.com/influxdata/influxdb )
57
68
- [ Prometheus] ( https://github.com/prometheus/prometheus )
69
+ - [ VictoriaMetrics] ( https://github.com/VictoriaMetrics/VictoriaMetrics )
58
70
- [ FreeCache] ( https://github.com/coocood/freecache )
71
+ - [ FastCache] ( https://github.com/VictoriaMetrics/fastcache )
0 commit comments