Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2790)

Issue 4672050: code review 4672050: sync: add fast paths to WaitGroup (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by dvyukov
Modified:
12 years, 9 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

sync: add fast paths to WaitGroup benchmark old ns/op new ns/op delta BenchmarkWaitGroupUncontended 93.50 33.60 -64.06% BenchmarkWaitGroupUncontended-2 44.30 16.90 -61.85% BenchmarkWaitGroupUncontended-4 21.80 8.47 -61.15% BenchmarkWaitGroupUncontended-8 12.10 4.86 -59.83% BenchmarkWaitGroupUncontended-16 7.38 3.35 -54.61% BenchmarkWaitGroupAddDone 58.40 33.70 -42.29% BenchmarkWaitGroupAddDone-2 293.00 85.80 -70.72% BenchmarkWaitGroupAddDone-4 243.00 51.10 -78.97% BenchmarkWaitGroupAddDone-8 236.00 52.20 -77.88% BenchmarkWaitGroupAddDone-16 215.00 43.30 -79.86% BenchmarkWaitGroupAddDoneWork 826.00 794.00 -3.87% BenchmarkWaitGroupAddDoneWork-2 450.00 424.00 -5.78% BenchmarkWaitGroupAddDoneWork-4 277.00 220.00 -20.58% BenchmarkWaitGroupAddDoneWork-8 440.00 116.00 -73.64% BenchmarkWaitGroupAddDoneWork-16 569.00 66.50 -88.31% BenchmarkWaitGroupWait 29.00 8.04 -72.28% BenchmarkWaitGroupWait-2 74.10 4.15 -94.40% BenchmarkWaitGroupWait-4 117.00 2.30 -98.03% BenchmarkWaitGroupWait-8 111.00 1.31 -98.82% BenchmarkWaitGroupWait-16 104.00 1.27 -98.78% BenchmarkWaitGroupWaitWork 802.00 792.00 -1.25% BenchmarkWaitGroupWaitWork-2 411.00 401.00 -2.43% BenchmarkWaitGroupWaitWork-4 210.00 199.00 -5.24% BenchmarkWaitGroupWaitWork-8 206.00 105.00 -49.03% BenchmarkWaitGroupWaitWork-16 334.00 54.40 -83.71%

Patch Set 1 #

Patch Set 2 : diff -r 743cfe1095ed https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 743cfe1095ed https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 743cfe1095ed https://go.googlecode.com/hg/ #

Total comments: 7

Patch Set 5 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 10 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 11 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Patch Set 12 : diff -r d5d51bacde3f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+271 lines, -15 lines) Patch
M src/pkg/sync/atomic/asm_386.s View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/sync/atomic/asm_amd64.s View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M src/pkg/sync/atomic/asm_linux_arm.s View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download
M src/pkg/sync/atomic/atomic_test.go View 1 2 3 4 5 6 7 8 2 chunks +102 lines, -0 lines 0 comments Download
M src/pkg/sync/atomic/doc.go View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/sync/waitgroup.go View 1 2 3 4 5 6 7 8 9 10 4 chunks +26 lines, -15 lines 0 comments Download
M src/pkg/sync/waitgroup_test.go View 1 2 3 4 5 2 chunks +105 lines, -0 lines 0 comments Download

Messages

Total messages: 6
dvyukov
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 9 months ago (2011-07-07 18:19:50 UTC) #1
rsc
http://codereview.appspot.com/4672050/diff/7002/src/pkg/sync/atomic/Makefile File src/pkg/sync/atomic/Makefile (right): http://codereview.appspot.com/4672050/diff/7002/src/pkg/sync/atomic/Makefile#newcode9 src/pkg/sync/atomic/Makefile:9: atomic_$(GOARCH).go\ Given that 99% of the code here is ...
12 years, 9 months ago (2011-07-12 05:19:43 UTC) #2
dvyukov
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 9 months ago (2011-07-18 14:11:00 UTC) #3
rsc
please add this comment. otherwise lgtm http://codereview.appspot.com/4672050/diff/32001/src/pkg/sync/waitgroup.go File src/pkg/sync/waitgroup.go (right): http://codereview.appspot.com/4672050/diff/32001/src/pkg/sync/waitgroup.go#newcode81 src/pkg/sync/waitgroup.go:81: atomic.AddInt32(&wg.waiters, 1) // ...
12 years, 9 months ago (2011-07-18 15:31:50 UTC) #4
dvyukov
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 9 months ago (2011-07-18 16:23:11 UTC) #5
rsc
12 years, 9 months ago (2011-07-18 16:36:02 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=8a1ad8e85973 ***

sync: add fast paths to WaitGroup
benchmark                                        old ns/op    new ns/op    delta
BenchmarkWaitGroupUncontended                        93.50        33.60  -64.06%
BenchmarkWaitGroupUncontended-2                      44.30        16.90  -61.85%
BenchmarkWaitGroupUncontended-4                      21.80         8.47  -61.15%
BenchmarkWaitGroupUncontended-8                      12.10         4.86  -59.83%
BenchmarkWaitGroupUncontended-16                      7.38         3.35  -54.61%
BenchmarkWaitGroupAddDone                            58.40        33.70  -42.29%
BenchmarkWaitGroupAddDone-2                         293.00        85.80  -70.72%
BenchmarkWaitGroupAddDone-4                         243.00        51.10  -78.97%
BenchmarkWaitGroupAddDone-8                         236.00        52.20  -77.88%
BenchmarkWaitGroupAddDone-16                        215.00        43.30  -79.86%
BenchmarkWaitGroupAddDoneWork                       826.00       794.00   -3.87%
BenchmarkWaitGroupAddDoneWork-2                     450.00       424.00   -5.78%
BenchmarkWaitGroupAddDoneWork-4                     277.00       220.00  -20.58%
BenchmarkWaitGroupAddDoneWork-8                     440.00       116.00  -73.64%
BenchmarkWaitGroupAddDoneWork-16                    569.00        66.50  -88.31%
BenchmarkWaitGroupWait                               29.00         8.04  -72.28%
BenchmarkWaitGroupWait-2                             74.10         4.15  -94.40%
BenchmarkWaitGroupWait-4                            117.00         2.30  -98.03%
BenchmarkWaitGroupWait-8                            111.00         1.31  -98.82%
BenchmarkWaitGroupWait-16                           104.00         1.27  -98.78%
BenchmarkWaitGroupWaitWork                          802.00       792.00   -1.25%
BenchmarkWaitGroupWaitWork-2                        411.00       401.00   -2.43%
BenchmarkWaitGroupWaitWork-4                        210.00       199.00   -5.24%
BenchmarkWaitGroupWaitWork-8                        206.00       105.00  -49.03%
BenchmarkWaitGroupWaitWork-16                       334.00        54.40  -83.71%

R=rsc
CC=golang-dev
http://codereview.appspot.com/4672050

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b