1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:21:21 -06:00
go/src/pkg/sync
Dmitriy Vyukov d2ab2b9f42 sync: improve Once fast path
Use atomic.LoadUint32(&done) instead of
atomic.AddInt32(&done, 0) on fast path.

benchmark            old ns/op    new ns/op    delta
BenchmarkOnce            13.40         7.26  -45.82%
BenchmarkOnce-2          22.90         4.04  -82.36%
BenchmarkOnce-4          25.60         2.16  -91.56%
BenchmarkOnce-8          25.80         1.38  -94.65%
BenchmarkOnce-16         24.40         1.33  -94.55%

(on HP Z600, 2 x Intel Xeon E5620, 8 HT cores, 2.4 GHz)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4787041
2011-07-21 11:30:14 -04:00
..
atomic sync/atomic: delete workaround 2011-07-20 08:39:24 +10:00
cond_test.go sync: always wake up previously sleeping goroutines on Cond.Signal 2011-06-01 20:30:42 -03:00
cond.go sync: always wake up previously sleeping goroutines on Cond.Signal 2011-06-01 20:30:42 -03:00
Makefile sync: use sync/atomic 2011-02-25 14:29:47 -05:00
mutex_test.go go/printer: changed max. number of newlines from 3 to 2 2011-07-14 14:39:40 -07:00
mutex.go sync: improve Mutex to allow successive acquisitions 2011-06-30 11:13:29 -04:00
once_test.go sync: add benchmark for Once. 2011-06-27 16:02:13 -04:00
once.go sync: improve Once fast path 2011-07-21 11:30:14 -04:00
rwmutex_test.go sync: improve RWMutex performance 2011-07-12 09:24:21 -07:00
rwmutex.go sync: improve RWMutex performance 2011-07-12 09:24:21 -07:00
waitgroup_test.go sync: add fast paths to WaitGroup 2011-07-18 12:35:55 -04:00
waitgroup.go sync: add fast paths to WaitGroup 2011-07-18 12:35:55 -04:00