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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UMPSCQueue is meant to serve as a replacement for a channel. However, crucially, it has infinite capacity. This is a very bad idea in many cases as it means that it never exhibits backpressure. In other words, if nothing is consuming elements from the queue, it will eventually consume all available memory and crash the process. However, there are also cases where this is desired behavior as it means the queue will dynamically allocate more memory to store temporary bursts, allowing producers to never block while the consumer catches up.
From now on, Map spawns additional goroutines to speed up resizing the hash table. This can be disabled when creating a Map with the new WithSerialResize setting:
m:= xsync.NewMap[int, int](xsync.WithSerialResize())
// resize will take place on the current goroutine onlyfori:=0; i<10000; i++ {
m.Store(i, i)
}
All non-generic data structures are now removed. Generic versions should be used instead - they use the old names, but type aliases are present to simplify v3-to-v4 code migration.
MapOf's hasher API is gone. The default and only hash function is now based on maphash.Comparable.
Map's Compute API now supports no-op (cancel) compute operation.
The old *Of types are kept as type aliases for the renamed data structures to simplify the migration, e.g. MapOf is an alias for Map.
NewMapOfPresized function is gone. NewMap combined with WithPresize should be used instead.
Map.Compute method now expects valueFn to return a ComputeOp value instead of a boolean flag. That's to support compute operation cancellation, so that the call does nothing.
Map.LoadOrTryCompute method is renamed to LoadOrCompute. The old LoadOrCompute method is removed as it was redundant.
Configuration
📅 Schedule: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
This PR contains the following updates:
v3.5.1
->v4.1.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
puzpuzpuz/xsync (github.com/puzpuzpuz/xsync/v3)
v4.1.0
Compare Source
UMPSCQueue
#168LoadAndDelete
andDelete
in case of non-existingMap
key #167Map
resize #170UMPSCQueue
is meant to serve as a replacement for a channel. However, crucially, it has infinite capacity. This is a very bad idea in many cases as it means that it never exhibits backpressure. In other words, if nothing is consuming elements from the queue, it will eventually consume all available memory and crash the process. However, there are also cases where this is desired behavior as it means the queue will dynamically allocate more memory to store temporary bursts, allowing producers to never block while the consumer catches up.From now on,
Map
spawns additional goroutines to speed up resizing the hash table. This can be disabled when creating aMap
with the newWithSerialResize
setting:Thanks @PapaCharlie and @llxisdsh for the contributions!
v4.0.0
Compare Source
MapOf
's hasher API is gone. The default and only hash function is now based onmaphash.Comparable
.Map
'sCompute
API now supports no-op (cancel) compute operation.Thanks @PapaCharlie for making this release happen
Migration notes
*Of
types are kept as type aliases for the renamed data structures to simplify the migration, e.g.MapOf
is an alias forMap
.NewMapOfPresized
function is gone.NewMap
combined withWithPresize
should be used instead.Map.Compute
method now expectsvalueFn
to return aComputeOp
value instead of a boolean flag. That's to support compute operation cancellation, so that the call does nothing.Map.LoadOrTryCompute
method is renamed toLoadOrCompute
. The oldLoadOrCompute
method is removed as it was redundant.Configuration
📅 Schedule: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.