Fastest and most memory efficient golang concurrent hashmap
add Clear()
function to haxmap https://github.com/alphadose/haxmap/pull/47 @semihbkgr
handle edge case to prevent panic during map initialization https://github.com/alphadose/haxmap/pull/44 @semihbkgr
This release is all thanks to @semihbkgr 🙏
GetAndDel
function similar to golang concurrent map's LoadAndDelete
https://github.com/alphadose/haxmap/pull/31
Set
operation after Delete
https://github.com/alphadose/haxmap/pull/34
CompareAndSwap
and Swap
APIs https://github.com/alphadose/haxmap/issues/18
GetOrCompute
API which works similar to GetOrSet
but the value is computed from a constructor which is called only once https://github.com/alphadose/haxmap/issues/16
Add GetOrSet()
API same as golang's sync.Map.LoadOrStore https://github.com/alphadose/haxmap/issues/15
Fix deadlock when multiple goroutines are trying to delete the same linked-list node https://github.com/alphadose/haxmap/commit/f4885e7522f138036dabe14c8eec0e5b7b66d0a6
map.Del(keyA, keyB, keyC...)
Set()
https://github.com/alphadose/haxmap/issues/7 https://github.com/alphadose/haxmap/issues/8
ForEach()
API to match golang's sync.Map.Range()
https://github.com/alphadose/haxmap/issues/10
Benchmarks were performed against golang sync.Map and the latest cornelk-hashmap
All results were computed from benchstat of 20 runs
name time/op
HaxMapReadsOnly-8 7.13µs ± 5%
GoSyncMapReadsOnly-8 22.4µs ± 2%
CornelkMapReadsOnly-8 8.28µs ± 1%
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%
Benchmarks were performed against golang sync.Map and cornelk-hashmap-v1.0.6 for sample 20 cases
name time/op
HaxMapReadsOnly-8 8.75µs ± 9%
GoSyncMapReadsOnly-8 22.0µs ±11%
CornelkMapReadsOnly-8 9.20µs ±10%
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%