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

Issue 6260051: code review 6260051: runtime: replace runtime·rnd function with ROUND macro (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by rsc
Modified:
13 years, 10 months ago
Reviewers:
dave
CC:
r, golang-dev
Visibility:
Public.

Description

runtime: replace runtime·rnd function with ROUND macro It's sad to introduce a new macro, but rnd shows up consistently in profiles, and the function call overwhelms the two arithmetic instructions it performs.

Patch Set 1 #

Patch Set 2 : diff -r 660f15dd7ecd https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 660f15dd7ecd https://go.googlecode.com/hg/ #

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -60 lines) Patch
M src/cmd/gc/reflect.c View 1 2 11 chunks +20 lines, -12 lines 0 comments Download
M src/pkg/runtime/chan.c View 1 2 10 chunks +10 lines, -10 lines 0 comments Download
src/pkg/runtime/hashmap.c View 1 2 10 chunks +11 lines, -11 lines 0 comments Download
M src/pkg/runtime/iface.c View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
src/pkg/runtime/print.c View 1 2 2 chunks +9 lines, -9 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
src/pkg/runtime/runtime.c View 1 1 chunk +0 lines, -13 lines 0 comments Download

Messages

Total messages: 4
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 10 months ago (2012-05-29 17:38:50 UTC) #1
r
LGTM
13 years, 10 months ago (2012-05-29 17:53:25 UTC) #2
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=722bb90ae3ee *** runtime: replace runtime·rnd function with ROUND macro It's sad to ...
13 years, 10 months ago (2012-05-29 18:02:34 UTC) #3
dave_cheney.net
13 years, 10 months ago (2012-05-29 22:18:16 UTC) #4
Thank you for submitting this russ. I did a benchmark run comparing last night
to +tip including this fix, on the whole the results are very encouraging.

There is one regression, which is BenchmarkSyscall.

pando(~/go/src/pkg/runtime) % ~/go/misc/benchcmp {old,new}.txt
benchmark                       old ns/op    new ns/op    delta
BenchmarkAppend                      5927         5905   -0.37%
BenchmarkAppendSpecialCase           5634         5537   -1.72%
BenchmarkSelectUncontended           3484         3401   -2.38%
BenchmarkSelectContended             3518         3388   -3.70%
BenchmarkSelectNonblock              1398         1030  -26.32%
BenchmarkChanUncontended              610          610   +0.00%
BenchmarkChanContended                611          611   +0.00%
BenchmarkChanSync                    2005         2062   +2.84%
BenchmarkChanProdCons0               1888         1927   +2.07%
BenchmarkChanProdCons10               926          928   +0.22%
BenchmarkChanProdCons100              651          651   +0.00%
BenchmarkChanProdConsWork0          14568        12589  -13.58%
BenchmarkChanProdConsWork10         12214        11535   -5.56%
BenchmarkChanProdConsWork100        11687        11251   -3.73%
BenchmarkChanCreation               10525        10303   -2.11%
BenchmarkChanSem                      621          621   +0.00%
BenchmarkCallClosure                   27           27   +0.00%
BenchmarkCallClosure1                  32           32   +0.00%
BenchmarkCallClosure2                2024         1978   -2.27%
BenchmarkCallClosure3                2022         2020   -0.10%
BenchmarkCallClosure4                2025         1996   -1.43%
BenchmarkComplex128DivNormal         1074         1098   +2.23%
BenchmarkComplex128DivNisNaN         1029         1003   -2.53%
BenchmarkComplex128DivDisNaN         1009         1027   +1.78%
BenchmarkComplex128DivNisInf          675          659   -2.37%
BenchmarkComplex128DivDisInf          612          610   -0.33%
BenchmarkMapUint8Get1                 724          522  -27.90%
BenchmarkMapUint8Get2                 734          528  -28.07%
BenchmarkMapUint8Put                  827          651  -21.28%
BenchmarkMapUint16Get1                730          522  -28.49%
BenchmarkMapUint16Get2                739          530  -28.28%
BenchmarkMapUint16Put                 830          651  -21.57%
BenchmarkMapUint32Get1                749          541  -27.77%
BenchmarkMapUint32Get2                743          547  -26.38%
BenchmarkMapUint32Put                 887          682  -23.11%
BenchmarkMapUint64Get1                792          600  -24.24%
BenchmarkMapUint64Get2                801          602  -24.84%
BenchmarkMapUint64Put                 902          725  -19.62%
BenchmarkConvT2E                      220           68  -68.95%
BenchmarkConvT2EBig                  2148         1965   -8.52%
BenchmarkConvT2I                      672          495  -26.34%
BenchmarkConvI2E                       38           38   +0.00%
BenchmarkConvI2I                      481          466   -3.12%
BenchmarkAssertE2T                     74           74   +0.27%
BenchmarkAssertE2TBig                  76           76   +0.26%
BenchmarkAssertE2I                    493          490   -0.61%
BenchmarkAssertI2T                     76           78   +2.08%
BenchmarkAssertI2I                    491          494   +0.61%
BenchmarkAssertI2E                     38           38   +0.52%
BenchmarkAssertE2E                     41           41   +2.20%
BenchmarkFinalizer                   3661         3121  -14.75%
BenchmarkFinalizerRun              105578       104028   -1.47%
BenchmarkStackGrowth                 5937         5835   -1.72%
BenchmarkSyscall                      241          241   +0.00%
BenchmarkSyscallWork                 9275        12002  +29.40%
BenchmarkIfaceCmp100                 2326         1971  -15.26%
BenchmarkIfaceCmpNil100              1566         1722   +9.96%
BenchmarkSoftMod                      220          224   +1.82%
BenchmarkSoftDiv                      225          237   +5.33%
Sign in to reply to this message.

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