Releases: alphadose/haxmap
Releases · alphadose/haxmap
140
131
130
120
110
102
101
Stable
Performance improvement
Notes
- Improve hashing performance by switching to pure arithmetic and bitmasking for known key sizes
Benchmarks
Benchmarks were performed against golang sync.Map and the latest cornelk-hashmap
All results were computed from benchstat of 20 runs
- Concurrent Reads Only
name time/op
HaxMapReadsOnly-8 7.13µs ± 5%
GoSyncMapReadsOnly-8 22.4µs ± 2%
CornelkMapReadsOnly-8 8.28µs ± 1%
- Concurrent Reads with Writes
name time/op
HaxMapReadsWithWrites-8 8.44µs ± 5%
GoSyncMapReadsWithWrites-8 26.1µs ± 2%
CornelkMapReadsWithWrites-8 9.55µs ± 2%
name alloc/op
HaxMapReadsWithWrites-8 1.22kB ± 6%
GoSyncMapReadsWithWrites-8 6.06kB ± 6%
CornelkMapReadsWithWrites-8 1.56kB ± 5%
name allocs/op
HaxMapReadsWithWrites-8 152 ± 6%
GoSyncMapReadsWithWrites-8 562 ± 6%
CornelkMapReadsWithWrites-8 195 ± 5%
Performance improvement and fix 32-bit compatibility
Notes
- Hashing performance improvement by type-casting keys to arrays instead of slices as seen in this commit eee8abe
- Fixed tests for 32 bit platforms (tested on my raspberry pi running 32 bit raspian OS)
- Make map growth policy synchronous
Benchmarks
Benchmarks were performed against golang sync.Map and cornelk-hashmap-v1.0.6 for sample 20 cases
- Concurrent Reads Only
name time/op
HaxMapReadsOnly-8 8.75µs ± 9%
GoSyncMapReadsOnly-8 22.0µs ±11%
CornelkMapReadsOnly-8 9.20µs ±10%
- Concurrent Reads with Writes
name time/op
HaxMapReadsWithWrites-8 10.0µs ± 9%
GoSyncMapReadsWithWrites-8 24.8µs ±11%
CornelkMapReadsWithWrites-8 10.5µs ± 9%
name alloc/op
HaxMapReadsWithWrites-8 1.29kB ± 6%
GoSyncMapReadsWithWrites-8 6.20kB ± 5%
CornelkMapReadsWithWrites-8 1.59kB ±10%
name allocs/op
HaxMapReadsWithWrites-8 161 ± 4%
GoSyncMapReadsWithWrites-8 574 ± 5%
CornelkMapReadsWithWrites-8 198 ±10%