You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is that this has no object allocation during the hash computation and does not use `ThreadLocal`.
21
+
https://guava.dev/releases/28.1-jre/api/docs/com/google/common/hash/package-summary.html[Guava hashing], is that this has no object allocation during the hash computation and does not use `ThreadLocal`.
23
22
24
23
The implementation utilises native access where possible, but is also platform-endianness-agnostic.
25
-
This provides consistent results whatever the byte order, while only moderately affecting
26
-
performance.
24
+
This provides consistent results whatever the byte order, while only moderately affecting performance.
25
+
26
+
Currently `long`-valued hash function interface is defined for 64-bit hash, and `long[]`-valued hash function interface for more than 64-bit hash, with the following implementations (in alphabetical order):
27
27
28
-
Currently `long`-valued hash function interface is defined for 64-bit hash, and `long[]`-valued hash
29
-
function interface for more than 64-bit hash, with the following implementations (in alphabetical
30
-
order):
28
+
- *https://github.com/google/cityhash[CityHash], version 1.1* (latest; 1.1.1 is a C++ language-specific maintenance release).
31
29
32
-
- *https://github.com/google/cityhash[CityHash], version 1.1* (latest; 1.1.1 is a C++
33
-
language-specific maintenance release).
30
+
- Two algorithms from *https://github.com/google/farmhash[FarmHash]*: `farmhashna` (introduced in FarmHash 1.0) and `farmhashuo` (introduced in FarmHash 1.1).
34
31
35
-
- Two algorithms from *https://github.com/google/farmhash[FarmHash]*: `farmhashna` (introduced
36
-
in FarmHash 1.0) and `farmhashuo` (introduced in FarmHash 1.1).
32
+
- *https://github.com/jandrewrogers/MetroHash[MetroHash]* (using the metrohash64_2 initialization vector).
37
33
38
-
- *https://github.com/jandrewrogers/MetroHash[MetroHash]* (using the metrohash64_2 initialization vector).
34
+
- *https://github.com/aappleby/smhasher/wiki/MurmurHash3[MurmurHash3]* 128-bit and low 64-bit.
39
35
40
-
- *https://github.com/aappleby/smhasher/wiki/MurmurHash3[MurmurHash3]* 128-bit and low 64-bit.
36
+
- *https://github.com/wangyi-fudan/wyhash[wyHash]*, version 3.
41
37
42
-
- *https://github.com/wangyi-fudan/wyhash[wyHash]*, version 3.
38
+
- *https://github.com/Cyan4973/xxHash[xxHash]*.
43
39
44
-
- *https://github.com/Cyan4973/xxHash[xxHash]*.
45
-
46
-
- *https://github.com/Cyan4973/xxHash[xxh3, xxh128]*, 128-bit and 64 bit.
40
+
- *https://github.com/Cyan4973/xxHash[xxh3, xxh128]*, 128-bit and 64 bit.
@@ -53,6 +47,7 @@ Other non-LTS JDKs from 9 should also work, but they will not be tested from hal
53
47
==== Performance
54
48
55
49
Tested on Intel Core i7-4870HQ CPU @ 2.50GHz
50
+
56
51
|===
57
52
|Algorithm |Speed, GB/s |Bootstrap, ns
58
53
@@ -69,43 +64,47 @@ Tested on Intel Core i7-4870HQ CPU @ 2.50GHz
69
64
To sum up,
70
65
71
66
==== When to use Zero-Allocation Hashing
72
-
* You need to hash plain byte sequences, memory blocks or "flat" objects.
73
-
* You want zero-allocation and good performance (at Java scale).
74
-
* You need hashing to be agile with regards to byte ordering.
67
+
68
+
* You need to hash plain byte sequences, memory blocks or "flat" objects.
69
+
* You want zero-allocation and good performance (at Java scale).
70
+
* You need hashing to be agile with regards to byte ordering.
75
71
76
72
==== When _not_ to use Zero-Allocation Hashing
77
-
* You need to hash POJOs whose actual data is scattered in memory between managed objects.
78
-
There is no simple way to hash these using this project, for example, classes such as:
73
+
74
+
* You need to hash POJOs whose actual data is scattered in memory between managed objects.
75
+
There is no simple way to hash these using this project, for example, classes such as:
79
76
+
80
-
[source,Java]
77
+
[source,Java]
81
78
----
82
79
class Person {
83
80
String givenName, surName;
84
81
int salary;
85
82
}
86
83
----
87
84
88
-
* You need to hash byte sequences of unknown length, for the simpliest example,
89
-
`Iterator<Byte>`.
85
+
* You need to hash byte sequences of unknown length, for the simpliest example,
86
+
`Iterator<Byte>`.
90
87
91
-
* You need to transform the byte sequence (e.g. encode or decode it with a specific coding),
92
-
and hash the resulting byte sequence on the way without dumping it to memory.
88
+
* You need to transform the byte sequence (e.g. encode or decode it with a specific coding), and hash the resulting byte sequence on the way without dumping it to memory.
93
89
94
90
==== Java Doc
91
+
95
92
See http://javadoc.io/doc/net.openhft/zero-allocation-hashing/latest
0 commit comments