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

Issue 13094043: code review 13094043: time: make timers heap 4-ary (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by funny.falcon
Modified:
11 years, 4 months ago
Reviewers:
dvyukov
CC:
golang-dev, dvyukov, bradfitz, r
Visibility:
Public.

Description

time: make timers heap 4-ary This slightly improves performance when a lot of timers are present $ misc/benchcmp ../old_timers_m.txt ../new_timers_m.txt benchmark old ns/op new ns/op delta BenchmarkAfterFunc 6884 6605 -4.05% BenchmarkAfterFunc-2 4473 4144 -7.36% BenchmarkAfterFunc-3 8601 6185 -28.09% BenchmarkAfterFunc-4 9378 8773 -6.45% BenchmarkAfter 7237 7278 +0.57% BenchmarkAfter-2 4638 3923 -15.42% BenchmarkAfter-3 8751 6239 -28.71% BenchmarkAfter-4 9223 8737 -5.27% BenchmarkStop 603 496 -17.74% BenchmarkStop-2 795 577 -27.42% BenchmarkStop-3 982 680 -30.75% BenchmarkStop-4 1164 739 -36.51% BenchmarkSimultaneousAfterFunc 657 593 -9.74% BenchmarkSimultaneousAfterFunc-2 816 757 -7.23% BenchmarkSimultaneousAfterFunc-3 844 830 -1.66% BenchmarkSimultaneousAfterFunc-4 785 771 -1.78% BenchmarkStartStop 238 239 +0.42% BenchmarkStartStop-2 249 234 -6.02% BenchmarkStartStop-3 271 268 -1.11% BenchmarkStartStop-4 293 295 +0.68%

Patch Set 1 #

Patch Set 2 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Patch Set 3 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Patch Set 4 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Patch Set 5 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Patch Set 6 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Patch Set 7 : diff -r 9b8afda16f02 https://code.google.com/p/go #

Total comments: 18

Patch Set 8 : diff -r 8bf13ae02c8e https://code.google.com/p/go #

Total comments: 2

Patch Set 9 : diff -r 8bf13ae02c8e https://code.google.com/p/go #

Patch Set 10 : diff -r 8bf13ae02c8e https://code.google.com/p/go #

Total comments: 5

Patch Set 11 : diff -r 8bf13ae02c8e https://code.google.com/p/go #

Total comments: 2

Patch Set 12 : diff -r 8bf13ae02c8e https://code.google.com/p/go #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -31 lines) Patch
M src/pkg/runtime/time.goc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +31 lines, -12 lines 2 comments Download
M src/pkg/time/sleep_test.go View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +81 lines, -19 lines 0 comments Download

Messages

Total messages: 27
funny.falcon
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 4 months ago (2013-08-18 15:19:33 UTC) #1
dvyukov
please add benchmark on what you measured performance
11 years, 4 months ago (2013-08-18 15:25:45 UTC) #2
funny.falcon
Hello golang-dev@googlegroups.com, dvyukov@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2013-08-18 17:10:41 UTC) #3
funny.falcon
Hello golang-dev@googlegroups.com, dvyukov@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2013-08-18 17:12:22 UTC) #4
funny.falcon
Hello golang-dev@googlegroups.com, dvyukov@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2013-08-18 17:13:15 UTC) #5
funny.falcon
Hello golang-dev@googlegroups.com, dvyukov@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2013-08-19 08:08:33 UTC) #6
bradfitz
R=dvyukov
11 years, 4 months ago (2013-08-19 16:49:11 UTC) #7
dvyukov
https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go#newcode110 src/pkg/time/sleep_test.go:110: func BenchmarkAfterFuncWithSmallGarbage(b *testing.B) { you still have lots of ...
11 years, 4 months ago (2013-08-19 22:59:40 UTC) #8
dvyukov
the time.goc part looks good nice speedups!
11 years, 4 months ago (2013-08-19 23:17:46 UTC) #9
funny.falcon
https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go#newcode110 src/pkg/time/sleep_test.go:110: func BenchmarkAfterFuncWithSmallGarbage(b *testing.B) { On 2013/08/19 22:59:40, dvyukov wrote: ...
11 years, 4 months ago (2013-08-20 08:45:15 UTC) #10
dvyukov
https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go#newcode180 src/pkg/time/sleep_test.go:180: nth := 8 On 2013/08/20 08:45:16, funny.falcon wrote: > ...
11 years, 4 months ago (2013-08-20 09:12:09 UTC) #11
dvyukov
https://codereview.appspot.com/13094043/diff/30001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/30001/src/pkg/time/sleep_test.go#newcode162 src/pkg/time/sleep_test.go:162: nth := 8 nth := runtime.GOMAXPROCS(0)
11 years, 4 months ago (2013-08-20 09:29:28 UTC) #12
funny.falcon
On 2013/08/20 09:12:09, dvyukov wrote: > https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go > File src/pkg/time/sleep_test.go (right): > > https://codereview.appspot.com/13094043/diff/21001/src/pkg/time/sleep_test.go#newcode180 > ...
11 years, 4 months ago (2013-08-20 10:10:48 UTC) #13
funny.falcon
https://codereview.appspot.com/13094043/diff/30001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/30001/src/pkg/time/sleep_test.go#newcode162 src/pkg/time/sleep_test.go:162: nth := 8 On 2013/08/20 09:29:28, dvyukov wrote: > ...
11 years, 4 months ago (2013-08-20 10:58:33 UTC) #14
dvyukov
https://codereview.appspot.com/13094043/diff/37001/src/pkg/time/sleep_test.go File src/pkg/time/sleep_test.go (right): https://codereview.appspot.com/13094043/diff/37001/src/pkg/time/sleep_test.go#newcode72 src/pkg/time/sleep_test.go:72: func benchmark(b *testing.B, bench func(n int), garbage_size int, go_koef ...
11 years, 4 months ago (2013-08-20 10:58:44 UTC) #15
dvyukov
please fill in CLA as described here: http://golang.org/doc/contribute.html#tmp_17
11 years, 4 months ago (2013-08-20 10:58:49 UTC) #16
r
This CL adds too many benchmarks that will likely take too much time.
11 years, 4 months ago (2013-08-20 12:49:51 UTC) #17
funny.falcon
On 2013/08/20 10:58:49, dvyukov wrote: > please fill in CLA as described here: > http://golang.org/doc/contribute.html#tmp_17 ...
11 years, 4 months ago (2013-08-20 13:12:01 UTC) #18
bradfitz
I've processed the CLA. On Tue, Aug 20, 2013 at 6:12 AM, <funny.falcon@gmail.com> wrote: > ...
11 years, 4 months ago (2013-08-20 15:22:11 UTC) #19
dvyukov
On 2013/08/20 15:22:11, bradfitz wrote: > I've processed the CLA. Thanks!
11 years, 4 months ago (2013-08-20 16:03:23 UTC) #20
dvyukov
I think this is the last nitpick, and we are ready to submit https://codereview.appspot.com/13094043/diff/46001/src/pkg/time/sleep_test.go File ...
11 years, 4 months ago (2013-08-20 16:23:30 UTC) #21
funny.falcon
Hello golang-dev@googlegroups.com, dvyukov@google.com, bradfitz@golang.org, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2013-08-21 09:29:18 UTC) #22
dvyukov
https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc#newcode240 src/pkg/runtime/time.goc:240: t[p] = tmp; don't you mess the heap here? ...
11 years, 4 months ago (2013-08-21 12:09:42 UTC) #23
funny.falcon
https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc#newcode240 src/pkg/runtime/time.goc:240: t[p] = tmp; On 2013/08/21 12:09:42, dvyukov wrote: > ...
11 years, 4 months ago (2013-08-21 14:14:10 UTC) #24
dvyukov
On 2013/08/21 14:14:10, funny.falcon wrote: > https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc > File src/pkg/runtime/time.goc (right): > > https://codereview.appspot.com/13094043/diff/52001/src/pkg/runtime/time.goc#newcode240 > ...
11 years, 4 months ago (2013-08-21 14:20:58 UTC) #25
dvyukov
LGTM
11 years, 4 months ago (2013-08-21 14:21:31 UTC) #26
dvyukov
11 years, 4 months ago (2013-08-21 14:51:54 UTC) #27
*** Submitted as https://code.google.com/p/go/source/detail?r=cddeaea05b11 ***

time: make timers heap 4-ary

This slightly improves performance when a lot of timers are present

$ misc/benchcmp ../old_timers_m.txt ../new_timers_m.txt
benchmark                           old ns/op    new ns/op    delta
BenchmarkAfterFunc                       6884         6605   -4.05%
BenchmarkAfterFunc-2                     4473         4144   -7.36%
BenchmarkAfterFunc-3                     8601         6185  -28.09%
BenchmarkAfterFunc-4                     9378         8773   -6.45%
BenchmarkAfter                           7237         7278   +0.57%
BenchmarkAfter-2                         4638         3923  -15.42%
BenchmarkAfter-3                         8751         6239  -28.71%
BenchmarkAfter-4                         9223         8737   -5.27%
BenchmarkStop                             603          496  -17.74%
BenchmarkStop-2                           795          577  -27.42%
BenchmarkStop-3                           982          680  -30.75%
BenchmarkStop-4                          1164          739  -36.51%
BenchmarkSimultaneousAfterFunc            657          593   -9.74%
BenchmarkSimultaneousAfterFunc-2          816          757   -7.23%
BenchmarkSimultaneousAfterFunc-3          844          830   -1.66%
BenchmarkSimultaneousAfterFunc-4          785          771   -1.78%
BenchmarkStartStop                        238          239   +0.42%
BenchmarkStartStop-2                      249          234   -6.02%
BenchmarkStartStop-3                      271          268   -1.11%
BenchmarkStartStop-4                      293          295   +0.68%

R=golang-dev, dvyukov, bradfitz, r
CC=golang-dev
https://codereview.appspot.com/13094043

Committer: Dmitriy Vyukov <dvyukov@google.com>
Sign in to reply to this message.

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