1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:30:26 -07:00
go/src
Ian Lance Taylor 756c352963 sync: simplify (*entry).tryStore
The only change to the go build -gcflags=-m=2 output was to remove
these two lines:

sync/map.go:178:26: &e.p escapes to heap
sync/map.go:178:26: 	from &e.p (passed to call[argument escapes]) at sync/map.go:178:25

Benchstat report for sync.Map benchmarks:

name                                            old time/op  new time/op  delta
LoadMostlyHits/*sync_test.DeepCopyMap-12        10.6ns ±11%  10.2ns ± 3%    ~     (p=0.299 n=10+8)
LoadMostlyHits/*sync_test.RWMutexMap-12         54.6ns ± 3%  54.6ns ± 2%    ~     (p=0.782 n=10+10)
LoadMostlyHits/*sync.Map-12                     10.1ns ± 1%  10.1ns ± 1%    ~     (p=1.127 n=10+8)
LoadMostlyMisses/*sync_test.DeepCopyMap-12      8.65ns ± 1%  8.77ns ± 5%  +1.39%  (p=0.017 n=9+10)
LoadMostlyMisses/*sync_test.RWMutexMap-12       53.6ns ± 2%  53.8ns ± 2%    ~     (p=0.408 n=10+9)
LoadMostlyMisses/*sync.Map-12                   7.37ns ± 1%  7.46ns ± 1%  +1.19%  (p=0.000 n=9+10)
LoadOrStoreBalanced/*sync_test.RWMutexMap-12     895ns ± 4%   906ns ± 3%    ~     (p=0.203 n=9+10)
LoadOrStoreBalanced/*sync.Map-12                 872ns ±10%   804ns ±12%  -7.75%  (p=0.014 n=10+10)
LoadOrStoreUnique/*sync_test.RWMutexMap-12      1.29µs ± 2%  1.28µs ± 1%    ~     (p=0.586 n=10+9)
LoadOrStoreUnique/*sync.Map-12                  1.30µs ± 7%  1.40µs ± 2%  +6.95%  (p=0.000 n=9+10)
LoadOrStoreCollision/*sync_test.DeepCopyMap-12  6.98ns ± 1%  6.91ns ± 1%  -1.10%  (p=0.000 n=10+10)
LoadOrStoreCollision/*sync_test.RWMutexMap-12    371ns ± 1%   372ns ± 2%    ~     (p=0.679 n=9+9)
LoadOrStoreCollision/*sync.Map-12               5.49ns ± 1%  5.49ns ± 1%    ~     (p=0.732 n=9+10)
Range/*sync_test.DeepCopyMap-12                 2.49µs ± 1%  2.50µs ± 0%    ~     (p=0.148 n=10+10)
Range/*sync_test.RWMutexMap-12                  54.7µs ± 1%  54.6µs ± 3%    ~     (p=0.549 n=9+10)
Range/*sync.Map-12                              2.74µs ± 1%  2.76µs ± 1%  +0.68%  (p=0.011 n=10+8)
AdversarialAlloc/*sync_test.DeepCopyMap-12      2.52µs ± 5%  2.54µs ± 7%    ~     (p=0.225 n=10+10)
AdversarialAlloc/*sync_test.RWMutexMap-12        108ns ± 1%   107ns ± 1%    ~     (p=0.101 n=10+9)
AdversarialAlloc/*sync.Map-12                    712ns ± 2%   714ns ± 3%    ~     (p=0.984 n=8+10)
AdversarialDelete/*sync_test.DeepCopyMap-12      581ns ± 3%   578ns ± 3%    ~     (p=0.781 n=9+9)
AdversarialDelete/*sync_test.RWMutexMap-12       126ns ± 2%   126ns ± 1%    ~     (p=0.883 n=10+10)
AdversarialDelete/*sync.Map-12                   155ns ± 8%   158ns ± 2%    ~     (p=0.158 n=10+9)

Change-Id: I1ed8e3109baca03087d0fad3df769fc7e38f6dbb
Reviewed-on: https://go-review.googlesource.com/137441
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-09-27 21:44:20 +00:00
..
archive
bufio
builtin builtin: document when len and cap are constant 2018-09-18 21:52:11 +00:00
bytes bytes, strings: add ReplaceAll 2018-09-26 20:51:23 +00:00
cmd cmd/go/internal/modfetch: update expected tags for external repos 2018-09-27 14:37:11 +00:00
compress compress: reduce copies of new text for compression testing 2018-09-24 18:26:02 +00:00
container
context
crypto all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
database/sql database/sql: fix Rows.Columns() documentation 2018-09-03 16:28:42 +00:00
debug debug/elf: add R_RISCV_32_PCREL relocation 2018-09-07 11:07:39 +00:00
encoding all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
errors
expvar expvar: fix name of Var interface 2018-09-06 05:43:52 +00:00
flag all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
fmt fmt: unify the printing examples 2018-09-24 21:15:52 +00:00
go go/build: clarify that there are no build tags for minor releases 2018-09-27 07:39:47 +00:00
hash
html all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
image image: make RegisterFormat safe for concurrent use 2018-09-26 23:14:57 +00:00
index/suffixarray
internal go/build: move isStandardPackage to new internal/goroot package 2018-09-25 22:07:43 +00:00
io ghchinoy: add example for ioutil.WriteFile 2018-08-30 18:38:34 +00:00
log
math cmd/compile: optimize math.Float64(32)bits and math.Float64(32)frombits on arm64 2018-09-17 20:49:04 +00:00
mime all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
net net/textproto: redo BenchmarkReadMIMEHeader 2018-09-27 19:58:04 +00:00
os all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
path all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
plugin
reflect reflect: use correct write barrier operations for method funcs 2018-09-26 21:12:16 +00:00
regexp regexp: fix incorrect name in Match doc comment 2018-09-13 16:29:06 +00:00
runtime runtime: simplify the control flow in sweepone 2018-09-27 18:04:50 +00:00
sort
strconv strconv: add example for IsGraphic 2018-09-03 05:45:52 +00:00
strings all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
sync sync: simplify (*entry).tryStore 2018-09-27 21:44:20 +00:00
syscall syscall: replace lstat, lchown, stat to please Android O 2018-09-24 17:08:51 +00:00
testdata compress: reduce copies of new text for compression testing 2018-09-24 18:26:02 +00:00
testing all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
text all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
time time: return ENOENT from androidLoadTzinfoFromTzdata if zone not found 2018-09-15 14:58:35 +00:00
unicode
unsafe
vendor/golang_org/x
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc