@@ -11,8 +11,6 @@ A Golang lock-free thread-safe HashMap optimized for fastest read access.
1111
1212It is not a general-use HashMap and currently has slow write performance for write heavy uses.
1313
14- The minimal supported Golang version is 1.19 as it makes use of Generics and the new atomic package helpers.
15-
1614## Usage
1715
1816Example uint8 key map uses:
@@ -44,34 +42,34 @@ count := atomic.LoadInt64(counter) // read counter
4442## Benchmarks
4543
4644Reading from the hash map for numeric key types in a thread-safe way is faster than reading from a standard Golang map
47- in an unsafe way and four times faster than Golang's ` sync.Map ` :
45+ in an unsafe way and three times faster than Golang's ` sync.Map ` :
4846
4947```
50- ReadHashMapUint -8 676ns ± 0%
51- ReadHaxMapUint -8 689ns ± 1%
52- ReadGoMapUintUnsafe -8 792ns ± 0%
53- ReadXsyncMapUint -8 954ns ± 0%
54- ReadGoSyncMapUint-8 2.62µs ± 1%
55- ReadSkipMapUint-8 3.27µs ±10%
56- ReadGoMapUintMutex-8 29.6µs ± 2%
48+ ReadXsyncMapUint -8 924.5n ± ∞ ¹
49+ ReadHashMapUint -8 1.072µ ± ∞ ¹
50+ ReadHaxMapUint -8 1.296µ ± ∞ ¹
51+ ReadGoMapUintUnsafe -8 1.318µ ± ∞ ¹
52+ ReadGoSyncMapUint-8 3.389µ ± ∞ ¹
53+ ReadSkipMapUint-8 4.820µ ± ∞ ¹
54+ ReadGoMapUintMutex-8 32.62µ ± ∞ ¹
5755```
5856
5957Reading from the map while writes are happening:
6058```
61- ReadHashMapWithWritesUint-8 860ns ± 1%
62- ReadHaxMapWithWritesUint-8 930ns ± 1%
63- ReadGoSyncMapWithWritesUint-8 3.06µs ± 2%
59+ ReadHashMapWithWritesUint-8 1.235µ ± ∞ ¹
60+ ReadHaxMapWithWritesUint-8 1.433µ ± ∞ ¹
61+ ReadGoSyncMapWithWritesUint-8 4.503µ ± ∞ ¹
6462```
6563
6664Write performance without any concurrent reads:
6765
6866```
69- WriteGoMapMutexUint-8 14.8µs ± 2%
70- WriteHashMapUint-8 22.3µs ± 1%
71- WriteGoSyncMapUint-8 69.3µs ± 0%
67+ WriteGoMapMutexUint-8 21.72µ ± ∞ ¹
68+ WriteHashMapUint-8 27.99µ ± ∞ ¹
69+ WriteGoSyncMapUint-8 78.43µ ± ∞ ¹
7270```
7371
74- The benchmarks were run with Golang 1.19.1 on Linux and a Ryzen 9 5900X CPU using ` make benchmark-perflock ` .
72+ The benchmarks were run with Golang 1.24.4 on Linux and a Ryzen 9 5900X CPU using ` make benchmark-perflock ` .
7573
7674## Technical details
7775
0 commit comments