summaryrefslogtreecommitdiff
path: root/test/bench/timing.log
blob: 9fc887eabed6669bb49da9e52575649e65512049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
All tests on r45 or r70

Aug 3 2009

First version of fasta. Translation of fasta.c, fetched from
	http://shootout.alioth.debian.org/u32q/benchmark.php?test=fasta&lang=gpp&id=4

fasta -n 25000000
	gcc -O2 fasta.c	5.98u 0.00s 6.01r
	gccgo -O2 fasta.go	8.82u 0.02s 8.85r
	6g fasta.go	13.50u 0.02s 13.53r
	6g -B fata.go	12.99u 0.02s 13.02r

Aug 4 2009
[added timing.sh]

# myrandom:
#   hand-written optimization of integer division
#   use int32->float conversion
fasta -n 25000000
	# probably I/O library inefficiencies
	gcc -O2 fasta.c	5.99u 0.00s 6.00r 
	gccgo -O2 fasta.go	8.82u 0.02s 8.85r
	gc fasta	10.70u 0.00s 10.77r
	gc_B fasta	10.09u 0.03s 10.12r

reverse-complement < output-of-fasta-25000000
	# we don't know - memory cache behavior?
	gcc -O2 reverse-complement.c	2.04u 0.94s 10.54r
	gccgo -O2 reverse-complement.go	6.54u 0.63s 7.17r
	gc reverse-complement	6.55u 0.70s 7.26r
	gc_B reverse-complement	6.32u 0.70s 7.10r

nbody 50000000
	# math.Sqrt needs to be in assembly; inlining is probably the other 50%
	gcc -O2 nbody.c	21.61u 0.01s 24.80r
	gccgo -O2 nbody.go	118.55u 0.02s 120.32r
	gc nbody	100.84u 0.00s 100.85r
	gc_B nbody	103.33u 0.00s 103.39r
[
hacked Sqrt in assembler
	gc nbody	31.97u 0.00s 32.01r
]

binary-tree 15 # too slow to use 20
	# memory allocation and garbage collection
	gcc -O2 binary-tree.c -lm	0.86u 0.00s 0.87r
	gccgo -O2 binary-tree.go	1.69u 0.46s 2.15r
	gccgo -O2 binary-tree-freelist.go	8.48u 0.00s 8.48r
	gc binary-tree	9.60u 0.01s 9.62r
	gc binary-tree-freelist	0.48u 0.01s 0.50r

August 5, 2009

fannkuch 12
	# bounds checking is half the difference
	# rest might be registerization
	gcc -O2 fannkuch.c	60.09u 0.01s 60.32r
	gccgo -O2 fannkuch.go	64.89u 0.00s 64.92r
	gc fannkuch	124.59u 0.00s 124.67r
	gc_B fannkuch	91.14u 0.00s 91.16r

regex-dna 100000
	# regexp code is slow on trivial regexp
	gcc -O2 regex-dna.c -lpcre	0.92u 0.00s 0.99r
	gc regexp-dna	26.94u 0.18s 28.75r
	gc_B regexp-dna	26.51u 0.09s 26.75r

spectral-norm 5500
	gcc -O2 spectral-norm.c -lm	11.54u 0.00s 11.55r
	gccgo -O2 spectral-norm.go	12.20u 0.00s 12.23r
	gc spectral-norm	50.23u 0.00s 50.36r
	gc_B spectral-norm	49.69u 0.01s 49.83r
	gc spectral-norm-parallel	24.47u 0.03s 11.05r  # has shift >>1 not div /2
	[using >>1 instead of /2 : gc gives 24.33u 0.00s 24.33r]

August 6, 2009

k-nucleotide 5000000
	# string maps are slower than glib string maps
	gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0	k-nucleotide.c: 10.72u 0.01s 10.74r
	gccgo -O2 k-nucleotide.go	21.64u 0.83s 22.78r
	gc k-nucleotide	16.08u 0.06s 16.50r
	gc_B k-nucleotide	17.32u 0.02s 17.37r

mandelbrot 5500
	# floating point code generator should use more registers
	gcc -O2 mandelbrot.c	56.13u 0.02s 56.17r
	gccgo -O2 mandelbrot.go	57.49u 0.01s 57.51r
	gc mandelbrot	74.32u 0.00s 74.35r
	gc_B mandelbrot	74.28u 0.01s 74.31r

meteor 16000
	# we don't know
	gcc -O2 meteor-contest.c	0.10u 0.00s 0.10r
	gccgo -O2 meteor-contest.go	0.12u 0.00s 0.14r
	gc meteor-contest	0.24u 0.00s 0.26r
	gc_B meteor-contest	0.23u 0.00s 0.24r

pidigits 10000
	# bignum is slower than gmp
	gcc -O2 pidigits.c -lgmp	2.60u 0.00s 2.62r
	gc pidigits	77.69u 0.14s 78.18r
	gc_B pidigits	74.26u 0.18s 75.41r
	gc_B pidigits	68.48u 0.20s 69.31r   # special case: no bounds checking in bignum

August 7 2009

# New gc does better division by powers of 2.  Significant improvements:

spectral-norm 5500
	# floating point code generator should use more registers; possibly inline evalA
	gcc -O2 spectral-norm.c -lm	11.50u 0.00s 11.50r
	gccgo -O2 spectral-norm.go	12.02u 0.00s 12.02r
	gc spectral-norm	23.98u 0.00s 24.00r	# new time is 0.48 times old time, 52% faster
	gc_B spectral-norm	23.71u 0.01s 23.72r	# ditto
	gc spectral-norm-parallel	24.04u 0.00s 6.26r  # /2 put back.  note: 4x faster (on r70, idle)

k-nucleotide 1000000
	# string maps are slower than glib string maps
	gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0	10.82u 0.04s 10.87r
	gccgo -O2 k-nucleotide.go	22.73u 0.89s 23.63r
	gc k-nucleotide	15.97u 0.03s 16.04r
	gc_B k-nucleotide	15.86u 0.06s 15.93r	# 8.5% faster, but probably due to weird cache effeccts in previous version

pidigits 10000
	# bignum is slower than gmp
	gcc -O2 pidigits.c -lgmp	2.58u 0.00s 2.58r
	gc pidigits	71.24u 0.04s 71.28r	# 8.5% faster
	gc_B pidigits	71.25u 0.03s 71.29r	# 4% faster

threadring 50000000
	gcc -O2 threadring.c -lpthread	35.51u 160.21s 199.50r
	gccgo -O2 threadring.go	90.33u 459.95s 448.03r
	gc threadring	33.11u 0.00s 33.14r
	GOMAXPROCS=4 gc threadring	114.48u 226.65s 371.59r
	# change wait code to do <-make(chan int) instead of time.Sleep
	gc threadring	28.41u 0.01s 29.35r
	GOMAXPROCS=4 gc threadring	112.59u 232.83s 384.72r
	
chameneos 6000000
	gcc -O2 chameneosredux.c -lpthread	18.14u 276.52s 76.93r
	gc chameneosredux	20.19u 0.01s 20.23r

Aug 10 2009

# new 6g with better fp registers, fast div and mod of integers
# complete set of timings listed. significant changes marked ***

fasta -n 25000000
	# probably I/O library inefficiencies
	gcc -O2 fasta.c	5.96u 0.00s 5.97r
	gc fasta	10.59u 0.01s 10.61r
	gc_B fasta	9.92u 0.02s 9.95r

reverse-complement < output-of-fasta-25000000
	# we don't know - memory cache behavior?
	gcc -O2 reverse-complement.c	1.96u 1.56s 16.23r
	gccgo -O2 reverse-complement.go	6.41u 0.62s 7.05r
	gc reverse-complement	6.46u 0.70s 7.17r
	gc_B reverse-complement	6.22u 0.72s 6.95r

nbody 50000000
	# math.Sqrt needs to be in assembly; inlining is probably the other 50%
	gcc -O2 nbody.c	21.26u 0.01s 21.28r
	gccgo -O2 nbody.go	116.68u 0.07s 116.80r
	gc nbody	86.64u 0.01s 86.68r	# -14%
	gc_B nbody	85.72u 0.02s 85.77r	# *** -17%

binary-tree 15 # too slow to use 20
	# memory allocation and garbage collection
	gcc -O2 binary-tree.c -lm	0.87u 0.00s 0.87r
	gccgo -O2 binary-tree.go	1.61u 0.47s 2.09r
	gccgo -O2 binary-tree-freelist.go	0.00u 0.00s 0.01r
	gc binary-tree	9.11u 0.01s 9.13r	# *** -5%
	gc binary-tree-freelist	0.47u 0.01s 0.48r

fannkuch 12
	# bounds checking is half the difference
	# rest might be registerization
	gcc -O2 fannkuch.c	59.92u 0.00s 59.94r
	gccgo -O2 fannkuch.go	65.54u 0.00s 65.58r
	gc fannkuch	123.98u 0.01s 124.04r
	gc_B fannkuch	90.75u 0.00s 90.78r

regex-dna 100000
	# regexp code is slow on trivial regexp
	gcc -O2 regex-dna.c -lpcre	0.91u 0.00s 0.92r
	gc regex-dna	27.25u 0.02s 27.28r
	gc_B regex-dna	29.51u 0.03s 29.55r

spectral-norm 5500
	# possibly inline evalA
	gcc -O2 spectral-norm.c -lm	11.57u 0.00s 11.57r
	gccgo -O2 spectral-norm.go	12.07u 0.01s 12.08r
	gc spectral-norm	23.99u 0.00s 24.00r
	gc_B spectral-norm	23.73u 0.00s 23.75r

k-nucleotide 1000000
	# string maps are slower than glib string maps
	gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0	10.63u 0.02s 10.69r
	gccgo -O2 k-nucleotide.go	23.19u 0.91s 24.12r
	gc k-nucleotide	16.73u 0.04s 16.78r	# *** +5% (but this one seems to vary by more than that)
	gc_B k-nucleotide	16.46u 0.04s 16.51r	# *** +5%

mandelbrot 16000
	gcc -O2 mandelbrot.c	56.16u 0.00s 56.16r
	gccgo -O2 mandelbrot.go	57.41u 0.01s 57.42r
	gc mandelbrot	64.05u 0.02s 64.08r	# *** -14%
	gc_B mandelbrot	64.10u 0.02s 64.14r	# *** -14%

meteor 16000
	# we don't know
	gcc -O2 meteor-contest.c	0.10u 0.00s 0.10r
	gccgo -O2 meteor-contest.go	0.12u 0.00s 0.12r
	gc meteor-contest	0.18u 0.00s 0.20r	# *** -25%
	gc_B meteor-contest	0.17u 0.00s 0.18r	# *** -24%

pidigits 10000
	# bignum is slower than gmp
	gcc -O2 pidigits.c -lgmp	2.57u 0.00s 2.57r
	gc pidigits	71.82u 0.04s 71.89r
	gc_B pidigits	71.84u 0.08s 71.98r

threadring 50000000
	gcc -O2 threadring.c -lpthread	30.91u 164.33s 204.57r
	gccgo -O2 threadring.go	87.12u 460.04s 447.61r
	gc threadring	38.55u 0.00s 38.56r	# *** +16%

chameneos 6000000
	gcc -O2 chameneosredux.c -lpthread	17.93u 323.65s 88.47r
	gc chameneosredux	21.72u 0.00s 21.73r

August 10 2009

# In-place versions for some bignum operations.
pidigits 10000
	gcc -O2 pidigits.c -lgmp	2.56u 0.00s 2.57r
	gc pidigits	55.22u 0.04s 55.29r	# *** -23%
	gc_B pidigits	55.49u 0.02s 55.60r	# *** -23%

September 3 2009

# New 6g inlines slices, has a few other tweaks.
# Complete rerun. Significant changes marked.

fasta -n 25000000
	# probably I/O library inefficiencies
	gcc -O2 fasta.c	5.96u 0.00s 5.96r
	gc fasta	10.63u 0.02s 10.66r
	gc_B fasta	9.92u 0.01s 9.94r

reverse-complement < output-of-fasta-25000000
	# we don't know - memory cache behavior?
	gcc -O2 reverse-complement.c	1.92u 0.33s 2.93r
	gccgo -O2 reverse-complement.go	6.76u 0.72s 7.58r	# +5%
	gc reverse-complement	6.59u 0.70s 7.29r	# +2%
	gc_B reverse-complement	5.57u 0.80s 6.37r	# -10%

nbody 50000000
	# math.Sqrt needs to be in assembly; inlining is probably the other 50%
	# also loop alignment appears to be critical
	gcc -O2 nbody.c	21.28u 0.00s 21.28r
	gccgo -O2 nbody.go	119.21u 0.00s 119.22r	# +2%
	gc nbody	109.72u 0.00s 109.78r	# + 28% *****
	gc_B nbody	85.90u 0.00s 85.91r

binary-tree 15 # too slow to use 20
	# memory allocation and garbage collection
	gcc -O2 binary-tree.c -lm	0.86u 0.00s 0.87r
	gccgo -O2 binary-tree.go	1.88u 0.54s 2.42r	# +17%
	gccgo -O2 binary-tree-freelist.go	0.01u 0.01s 0.02r
	gc binary-tree	8.94u 0.01s 8.96r	# -2%
	gc binary-tree-freelist	0.47u 0.01s 0.48r

fannkuch 12
	# bounds checking is half the difference
	# rest might be registerization
	gcc -O2 fannkuch.c	60.12u 0.00s 60.12r
	gccgo -O2 fannkuch.go	92.62u 0.00s 92.66r		# +41% ***
	gc fannkuch	123.90u 0.00s 123.92r
	gc_B fannkuch	89.71u 0.00s 89.74r	# -1%

regex-dna 100000
	# regexp code is slow on trivial regexp
	gcc -O2 regex-dna.c -lpcre	0.88u 0.00s 0.88r
	gc regex-dna	25.77u 0.01s 25.79r		# -5%
	gc_B regex-dna	26.05u 0.02s 26.09r	# -12% ***

spectral-norm 5500
	# possibly inline evalA
	gcc -O2 spectral-norm.c -lm	11.51u 0.00s 11.51r
	gccgo -O2 spectral-norm.go	11.95u 0.00s 11.96r
	gc spectral-norm	24.23u 0.00s 24.23r
	gc_B spectral-norm	23.83u 0.00s 23.84r

k-nucleotide 1000000
	# string maps are slower than glib string maps
	gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0	10.68u 0.04s 10.72r
	gccgo -O2 k-nucleotide.go	23.03u 0.88s 23.92r
	gc k-nucleotide	15.79u 0.05s 15.85r	# -5% (but this one seems to vary by more than that)
	gc_B k-nucleotide	17.88u 0.05s 17.95r # +8% (ditto)

mandelbrot 16000
	gcc -O2 mandelbrot.c	56.17u 0.02s 56.20r
	gccgo -O2 mandelbrot.go	56.74u 0.02s 56.79r	 # -1%
	gc mandelbrot	63.31u 0.01s 63.35r	# -1%
	gc_B mandelbrot	63.29u 0.00s 63.31r	# -1%

meteor 16000
	# we don't know
	gcc -O2 meteor-contest.c	0.10u 0.00s 0.10r
	gccgo -O2 meteor-contest.go	0.11u 0.00s 0.12r
	gc meteor-contest	0.18u 0.00s 0.19r
	gc_B meteor-contest	0.17u 0.00s 0.18r

pidigits 10000
	# bignum is slower than gmp
	gcc -O2 pidigits.c -lgmp	2.56u 0.00s 2.57r
	gc pidigits	55.87u 0.03s 55.91r
	gc_B pidigits	55.93u 0.03s 55.99r

# these tests are compared using real time, since they run multiple processors
# accuracy probably low
threadring 50000000
	gcc -O2 threadring.c -lpthread	26.31u 164.69s 199.92r	# -2%
	gccgo -O2 threadring.go	87.90u 487.26s 472.81r	# +6%
	gc threadring	28.89u 0.00s 28.90r	# -25% ***

chameneos 6000000
	gcc -O2 chameneosredux.c -lpthread	16.41u 296.91s 81.17r	# -8%
	gc chameneosredux	19.97u 0.00s 19.97r	# -8%