Skip to content

Commit 85f5bb8

Browse files
alityrsc
authored andcommitted
test/bench: a couple fixes to timing.sh
- Skip the gccgo tests if we don't have it - Add -lm so nbody.c will compile - Pass 2098 to the meteor test (cf. the shootout site) R=rsc, r, iant CC=golang-dev https://golang.org/cl/3619042
1 parent 7a4ce23 commit 85f5bb8

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

test/bench/timing.log

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ mandelbrot 5500
9090
gc mandelbrot 74.32u 0.00s 74.35r
9191
gc_B mandelbrot 74.28u 0.01s 74.31r
9292

93-
meteor 16000
93+
meteor 2100
9494
# we don't know
9595
gcc -O2 meteor-contest.c 0.10u 0.00s 0.10r
9696
gccgo -O2 meteor-contest.go 0.12u 0.00s 0.14r
@@ -209,7 +209,7 @@ mandelbrot 16000
209209
gc mandelbrot 64.05u 0.02s 64.08r # *** -14%
210210
gc_B mandelbrot 64.10u 0.02s 64.14r # *** -14%
211211

212-
meteor 16000
212+
meteor 2100
213213
# we don't know
214214
gcc -O2 meteor-contest.c 0.10u 0.00s 0.10r
215215
gccgo -O2 meteor-contest.go 0.12u 0.00s 0.12r
@@ -307,7 +307,7 @@ mandelbrot 16000
307307
gc mandelbrot 63.31u 0.01s 63.35r # -1%
308308
gc_B mandelbrot 63.29u 0.00s 63.31r # -1%
309309

310-
meteor 16000
310+
meteor 2100
311311
# we don't know
312312
gcc -O2 meteor-contest.c 0.10u 0.00s 0.10r
313313
gccgo -O2 meteor-contest.go 0.11u 0.00s 0.12r
@@ -477,7 +477,7 @@ mandelbrot 16000
477477
gc mandelbrot 66.05u 0.00s 66.07r # -3%
478478
gc_B mandelbrot 66.06u 0.00s 66.07r # -3%
479479

480-
meteor 16000
480+
meteor 2100
481481
gcc -O2 meteor-contest.c 0.10u 0.00s 0.10r
482482
gccgo -O2 meteor-contest.go 0.12u 0.00s 0.12r
483483
gc meteor-contest 0.17u 0.00s 0.17r
@@ -561,7 +561,7 @@ mandelbrot 16000
561561
gc mandelbrot 64.85u 0.01s 64.94r
562562
gc_B mandelbrot 65.02u 0.01s 65.14r
563563

564-
meteor 16000
564+
meteor 2100
565565
gcc -O2 meteor-contest.c 0.10u 0.00s 0.10r
566566
gccgo -O2 meteor-contest.go 0.10u 0.00s 0.11r
567567
gc meteor-contest 0.17u 0.00s 0.18r

test/bench/timing.sh

+16-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ set -e
88
eval $(gomake --no-print-directory -f ../../src/Make.inc go-env)
99
PATH=.:$PATH
1010

11+
havegccgo=false
12+
if which gccgo >/dev/null 2>&1
13+
then
14+
havegccgo=true
15+
fi
16+
1117
mode=run
1218
case X"$1" in
1319
X-test)
@@ -30,8 +36,6 @@ runonly() {
3036
fi
3137
}
3238

33-
34-
3539
run() {
3640
if [ $mode = test ]
3741
then
@@ -57,6 +61,10 @@ run() {
5761
fi
5862
return
5963
fi
64+
if ! $havegccgo && echo $1 | grep -q '^gccgo '
65+
then
66+
return
67+
fi
6068
echo -n ' '$1' '
6169
$1
6270
shift
@@ -85,7 +93,7 @@ revcomp() {
8593
8694
nbody() {
8795
runonly echo 'nbody -n 50000000'
88-
run 'gcc -O2 nbody.c' a.out 50000000
96+
run 'gcc -O2 -lm nbody.c' a.out 50000000
8997
run 'gccgo -O2 nbody.go' a.out -n 50000000
9098
run 'gc nbody' $O.out -n 50000000
9199
run 'gc_B nbody' $O.out -n 50000000
@@ -152,11 +160,11 @@ mandelbrot() {
152160
}
153161
154162
meteor() {
155-
runonly echo 'meteor 16000'
156-
run 'gcc -O2 meteor-contest.c' a.out
157-
run 'gccgo -O2 meteor-contest.go' a.out
158-
run 'gc meteor-contest' $O.out
159-
run 'gc_B meteor-contest' $O.out
163+
runonly echo 'meteor 2098'
164+
run 'gcc -O2 meteor-contest.c' a.out 2098
165+
run 'gccgo -O2 meteor-contest.go' a.out -n 2098
166+
run 'gc meteor-contest' $O.out -n 2098
167+
run 'gc_B meteor-contest' $O.out -n 2098
160168
}
161169
162170
pidigits() {

0 commit comments

Comments
 (0)