mirror of
https://github.com/golang/go
synced 2024-11-06 02:26:17 -07:00
2e8dbae85c
This CL implements a LoadAndDelete method in sync.Map. Benchmark: name time/op LoadAndDeleteBalanced/*sync_test.RWMutexMap-12 98.8ns ± 1% LoadAndDeleteBalanced/*sync.Map-12 10.3ns ±11% LoadAndDeleteUnique/*sync_test.RWMutexMap-12 99.2ns ± 2% LoadAndDeleteUnique/*sync.Map-12 6.63ns ±10% LoadAndDeleteCollision/*sync_test.DeepCopyMap-12 140ns ± 0% LoadAndDeleteCollision/*sync_test.RWMutexMap-12 75.2ns ± 2% LoadAndDeleteCollision/*sync.Map-12 5.21ns ± 5% In addition, Delete is bounded and more efficient if many collisions: DeleteCollision/*sync_test.DeepCopyMap-12 120ns ± 2% 125ns ± 1% +3.80% (p=0.000 n=10+9) DeleteCollision/*sync_test.RWMutexMap-12 73.5ns ± 3% 79.5ns ± 1% +8.03% (p=0.000 n=10+9) DeleteCollision/*sync.Map-12 97.8ns ± 3% 5.9ns ± 4% -94.00% (p=0.000 n=10+10) Fixes #33762 Change-Id: Ic8469a7861d27ab0edeface0078aad8af9b26c2f Reviewed-on: https://go-review.googlesource.com/c/go/+/205899 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
---|---|---|
.. | ||
except.txt | ||
go1.1.txt | ||
go1.2.txt | ||
go1.3.txt | ||
go1.4.txt | ||
go1.5.txt | ||
go1.6.txt | ||
go1.7.txt | ||
go1.8.txt | ||
go1.9.txt | ||
go1.10.txt | ||
go1.11.txt | ||
go1.12.txt | ||
go1.13.txt | ||
go1.14.txt | ||
go1.txt | ||
next.txt | ||
README |
Files in this directory are data for Go's API checker ("go tool api", in src/cmd/api). Each file is a list of API features, one per line. go1.txt (and similarly named files) are frozen once a version has been shipped. Each file adds new lines but does not remove any. except.txt lists features that may disappear without breaking true compatibility. next.txt is the only file intended to be mutated. It's a list of features that may be added to the next version. It only affects warning output from the go api tool.