NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules
Go modules, #1122 by repository stars
Latest stable
v3.5.1
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 6 months
Nearly every release is documented
notes for 11 of 11 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
24 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Clarify docs for LoadOrCompute and LoadOrTryCompute #154
LoadOrCompute and LoadOrTryCompute #154Nothing published for this version
Add LoadOrTryCompute method to Map/MapOf #153
SPSCQueue/SPSCQueueOf #152LoadOrTryCompute method to Map/MapOf #153Thanks @mattjohnsonpint for suggesting the map enhancement.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Add ToPlainMap/ToPlainMapOf utility functions #151
ToPlainMap/ToPlainMapOf utility functions #151Thanks @KiddoV for suggesting this enhancement.
Add optimistic locking methods to RBMutex #138 and #140
RBMutex #138 and #140Map/MapOf capacity calculation for WithPresize #139RBMutex now has methods for optimistic locking:
mu := xsync.NewRBMutex()
if locked, t := mu.TryRLock(); locked {
// critical reader section...
mu.RUnlock(t)
}
if mu.TryLock() {
// critical writer section...
mu.Unlock()
}
Thanks @kkroo for the contribution.
Nothing published for this version
Nothing published for this version
Add NewMapOfWithHasher function #137
NewMapOfWithHasher function #137Adds NewMapOfWithHasher function to support custom hash functions in MapOf:
m := NewMapOfWithHasher[int, int](func(i int, _ uint64) uint64 {
// Murmur3 finalizer. No DDOS protection as it does not support seed.
h := uint64(i)
h = (h ^ (h >> 33)) * 0xff51afd7ed558ccd
h = (h ^ (h >> 33)) * 0xc4ceb9fe1a85ec53
return h ^ (h >> 33)
})
Some custom hash functions may be faster than the built-in function if the lack of DDOS protection is fine.
Murmur3 finalizer:
BenchmarkMapOfInt_Murmur3Finalizer_WarmUp/reads=100%-8 525864650 2.240 ns/op 446360938 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_Murmur3Finalizer_WarmUp/reads=99%-8 383333918 3.127 ns/op 319827294 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_Murmur3Finalizer_WarmUp/reads=90%-8 267635385 4.535 ns/op 220506863 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_Murmur3Finalizer_WarmUp/reads=75%-8 181292007 6.448 ns/op 155092697 ops/s 2 B/op 0 allocs/op
Built-in hash function:
BenchmarkMapOfInt_WarmUp/reads=100%-8 431097415 2.858 ns/op 349837551 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_WarmUp/reads=99%-8 307244330 3.951 ns/op 253072903 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_WarmUp/reads=90%-8 226392990 5.306 ns/op 188477583 ops/s 0 B/op 0 allocs/op
BenchmarkMapOfInt_WarmUp/reads=75%-8 159236962 7.513 ns/op 133108546 ops/s 2 B/op 0 allocs/op
Nothing published for this version
Expose Map/MapOf statistics #133
MapOf lookups #134Map/MapOf statistics #133Introduces meta memory and SWAR-based lookups similar to C++'s absl::flat_hash_map hash table (https://abseil.io/docs/cpp/guides/container). The lookups are now up to 30% faster.
Also, reduces MapOf's memory overhead: each bucket now holds up to 5 entries instead of 3.
Map/MapOf statistics are available via m.Stats(). They may be used for diagnostic purposes.
Nothing published for this version
Nothing published for this version
NewPresizedMap/NewPresizedMapOf functions are deprecated. Use the WithPresize option instead.
Adds options support to the NewMap/NewMapOf functions. A MapOf can now be created like this:
m := xsync.NewMapOf[int, int](WithPresize(100))
NewPresizedMap/NewPresizedMapOf functions are deprecated. Use the WithPresize option instead.
Also, adds WithGrowOnly option. It configures new Map/MapOf instance to be grow-only. This means that the underlying hash table grows in capacity when new keys are added, but does not shrink when keys are deleted. The only exception to this rule is the Clear method which shrinks the hash table back to the initial capacity.
Grow-only maps are more efficient in the case of oscillating map size, i.e. when the map frequently grows and then shrinks in size.
Nothing published for this version
Nothing published for this version
Use presized Map/MapOf argument as the minimal map capacity
NewMapPresized/NewMapOfPresized's argument is now treated as the minimal table capacity. The underlying hash table won't shrink beyond the specified capacity.
Also, fixes and improves godoc.
Fix too aggressive Map/MapOf shrinking on deletion leading to out of range panic
Thanks @mdumandag for reporting the issue.
Nothing published for this version
Fix lost updates on concurrent Map/MapOf resize
Map/MapOf resize (#111)Thanks @klauspost for reporting this issue.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Replace the user-defined hash function in MapOf factories with a built-in fast hash function (#107, #108)
All New*MapOf* functions are now replaced with the NewMapOf and NewMapOfPresized functions. There is no longer a need to provide a user-defined hash function.
Kudos go to @destel
Nothing published for this version
One column per quarter.