executing: time xgraph examples/benching.xg 2>/dev/null
Current file: examples/benching.xg: Sun Jan 25 00:36:17 2004
A collection of timing benchmarks. Can take quite a while to complete, and doesn't generate
overly nice output! Performance measured in bogoflops, <err> I mean seconds :)
Current xgraph info:
 xgraph examples/benching.xg
 XGraph build version 20040311; gcc3.3.0[Mar 11 2004 23:43:54,"Darwin CuneiPower.local 7.2.0 Power Macintosh ; CC='gccopt -DXGRAPH ' ACC='gccopt -DXGRAPH '"]
 Executed d.d. Thu Mar 11 23:47:29 2004
 Input files: 'examples/benching.xg: Sun Jan 25 00:36:17 2004' 
 Working directory: /Users/bertin/work/src/xgraph
 Last opened on display :0.0/-1/-1 (visual 0x22, 24 planes TrueColor) by bertin


1.00000e+06 times empty loop took 0.327992(real)/0.330000(user) sec [3.04885e+06R/3.03030e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.698756(real)/0.670000(user) sec [1.43111e+06R/1.49254e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.697503(real)/0.680000(user) sec [1.43369e+06R/1.47059e+06U]l/s seconds
Calibrating adapted loop size (should be 1s)... 1.43368e+06 times looping empty procedure took 1.01822(real)/0.980000(user) sec [1.40803e+06R/1.46294e+06U]l/s seconds

timing of addition of 2 arrays, either with a for-toMAX[] loop construct (scalar addition), or
with (internal) array addition. The latter is done 10x to increase the reliability of the measured
duration. Procedures are used to ensure that the code is executed from compiled representations
(*EVAL* would not automatically compile the array-addition test procedure [test2]).
On a PIII 450Mhz (linux), test1 completes in around 5.8s, test2 almost instantly (3.94959e-04s)

Addition of 2 [1.43368e+06] arrays in a scalar-addition loop, without support for simple array arithmetic: 4.36583(real)/4.29000(user) sec [328388R/334192U]l/s
	Result z==2  0
Addition of 2 [1.43368e+06] arrays in a scalar-addition loop, with support for simple array arithmetic: 4.89921(real)/4.80000(user) sec [292636R/298684U]l/s
	Result z==2  0
Addition of 2 [1.43368e+06] arrays with scalar-addition and Apply2Array, without support for simple array arithmetic: 2.69746(real)/2.64000(user) sec [531494R/543063U]l/s
	Result z==2  0
Addition of 2 [1.43368e+06] arrays with scalar-addition and Apply2Array, with support for simple array arithmetic: 3.25002(real)/3.19000(user) sec [441131R/449431U]l/s
	Result z==2  0
Addition of a scalar to a [1.43368e+06] array with scalar-addition, without support for simple array arithmetic: 4.12729(real)/4.06000(user) sec [347367R/353124U]l/s
	Result z==716843  413869
Addition of a scalar to a [1.43368e+06] array with scalar-addition, with support for simple array arithmetic: 4.63414(real)/4.59000(user) sec [309375R/312350U]l/s
	Result z==716843  413869
Addition of a scalar to a [1.43368e+06] array with scalar-addition and Apply2Array, without support for simple array arithmetic: 0.271935(real)/0.270000(user) sec [5.27216e+06R/5.30994e+06U]l/s
	Result z==716843  413869
Addition of a scalar to a [1.43368e+06] array with scalar-addition and Apply2Array, with support for simple array arithmetic: 0.830855(real)/0.820000(user) sec [1.72555e+06R/1.74840e+06U]l/s
	Result z==716843  413869
10x array[1.43368e+06] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 3.20000e-04(real)/0(user) sec [4.48027e+09R/InfU]l/s
	Result z==0  0
10x array[1.43368e+06] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 0.804559(real)/0.750000(user) sec [1.78195e+06R/1.91158e+06U]l/s
	Result z==2  0
1.43368e+06x array[10] addition with support for simple array arithmetic, array addition: 23.6397(real)/12.5700(user) sec [60647.4R/114056U]l/s
	Result zz==5.50000  3.02765
10x array[1.43368e+06] multiplication with support for simple array arithmetic, array addition (mul[&z,&x,&y]): 0.805650(real)/0.770000(user) sec [1.77954e+06R/1.86193e+06U]l/s
	Result z==1  0
1.43368e+06x array[10] multiplication with support for simple array arithmetic, array addition: 23.5332(real)/12.4800(user) sec [60921.9R/114879U]l/s
	Result zz==4.50000  3.02765
10x array[1.43368e+06] division with support for simple array arithmetic, array addition (div[&z,&x,&y]): 1.34582(real)/1.31000(user) sec [1.06529e+06R/1.09442e+06U]l/s
	Result z==1  0
1.43368e+06x array[10] division with support for simple array arithmetic, array addition: 23.9927(real)/13.0500(user) sec [59755.0R/109861U]l/s
	Result zz==4.50000  3.02765
procedure calling overhead compared to functions, $UseConstantsLists=1
1.43368e+06 times v1,v2: 0.784618(real)/0.770000(user) sec [1.82724e+06R/1.86193e+06U]l/s
1.43368e+06 times v1[v2],v2[v1]=120,120: 1.08610(real)/1.03000(user) sec [1.32003e+06R/1.39193e+06U]l/s
1.43368e+06 times v[0],v[1]: 1.24814(real)/1.23000(user) sec [1.14866e+06R/1.16560e+06U]l/s
1.43368e+06 times v[0,v1],v[1,v2]=100,120: 1.66120(real)/1.64000(user) sec [863041R/874198U]l/s
1.43368e+06 times v[0,v1,v2]=100,120: 1.79387(real)/1.75000(user) sec [799212R/819249U]l/s
1.43368e+06 times empty=0: 1.01240(real)/1(user) sec [1.41612e+06R/1.43368e+06U]l/s
1.43368e+06 times empty[v1,v2]=0: 1.60396(real)/1.60000(user) sec [893842R/896053U]l/s
1.43368e+06 times add[v1,v2]=220: 2.19839(real)/2.14000(user) sec [652153R/669946U]l/s
1.43368e+06 times add[v[0],v[1]]=220: 2.47867(real)/2.41000(user) sec [578408R/594890U]l/s
1.43368e+06 times call[&add,v1,v2]=220: 5.74794(real)/3.88000(user) sec [249426R/369507U]l/s
1.43368e+06 times sumvv=220: 3.05624(real)/3.04000(user) sec [469101R/471607U]l/s
1.43368e+06 times sum[v1,v2]=220: 3.98593(real)/3.93000(user) sec [359687R/364805U]l/s
1.43368e+06 times call[&sum,v1,v2]=220: 8.86862(real)/6.97000(user) sec [161658R/205694U]l/s
1.43368e+06 times call[lambda[add[$[0],$[1]]],v1,v2]=220: 8.84619(real)/6.90000(user) sec [162068R/207781U]l/s
1.43368e+06 times sum[v1,ran]=100.588: 5.45197(real)/5.39000(user) sec [262967R/265990U]l/s
1.43368e+06 times call[&sum,v1,ran]=100.884->100.345: 10.7587(real)/8.99000(user) sec [133258R/159476U]l/s

Comparing the special 2-D indexing function 2Dindex to nDindex

1.43368e+06 times 2Dindex[1,2,3,4]: 2.68552(real)/2.65000(user) sec [533859R/541013U]l/s
1.43368e+06 times nDindex[1,2,3,4]: 3.16637(real)/3.11000(user) sec [452785R/460992U]l/s
1.43368e+06 times @[&zz,$loop]==-123.456: 6.00540(real)/4.11000(user) sec [238733R/348829U]l/s
1.43368e+06 times @[`"1234567890"]==2.12044e+10 5.68788(real)/4(user) sec [252060R/358421U]l/s

Some loops to time the effect of $UseConstantsLists (and the '?' last-value operator):

1.43368e+06 times 'progn[2,add[2,kk]]' took 3.93003(real)/3.87000(user) sec [364803R/370461U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'progn[2,?add,?ran]' took 2.47395(real)/2.45000(user) sec [579514R/585178U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'progn[2,add[2,kk]]' took 3.67668(real)/3.63000(user) sec [389941R/394955U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'progn[2,?add,?ran]' took 2.24365(real)/2.17000(user) sec [638998R/660684U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'var[foo[?ran]]'=0.236295 took 3.53201(real)/3.47000(user) sec [405912R/413166U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'var[foo[?ran]]'=0.236295 took 1.18258(real)/1.15000(user) sec [1.21233e+06R/1.24668e+06U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'var'=0 took 0.865710(real)/0.830000(user) sec [1.65608e+06R/1.72733e+06U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'var'=0 took 0.673907(real)/0.660000(user) sec [2.12742e+06R/2.17225e+06U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'var[$loop]'=1.43368e+06 took 2.22259(real)/2.17000(user) sec [645052R/660684U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'var[$loop]'=1.43368e+06 took 0.833455(real)/0.800000(user) sec [1.72017e+06R/1.79211e+06U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'var[foo[$loop]]'=1.43368e+06 took 3.55163(real)/3.50000(user) sec [403670R/409624U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'var[foo[$loop]]'=1.43368e+06 took 1.20456(real)/1.15000(user) sec [1.19022e+06R/1.24668e+06U]l/s seconds with $UseConstantsLists=1
1.43368e+06 times 'var[foo[bar[$loop]]]'=1.43368e+06 took 4.89845(real)/4.79000(user) sec [292681R/299308U]l/s seconds with $UseConstantsLists=0
1.43368e+06 times 'var[foo[bar[$loop]]]'=1.43368e+06 took 2.57078(real)/2.52000(user) sec [557685R/568923U]l/s seconds with $UseConstantsLists=1
477895 times stats-test1 (ss10=8.000695.77256 ; sas10=3.998045.77256): 
	took 3.42737(real)/3.38000(user) sec [418305R/424167U]l/s seconds with $UseConstantsLists=0
477895 times stats-test2 (ss11=19.988214.7105 ; sas11=10.000314.7105): 
	took 4.92035(real)/4.86000(user) sec [291379R/294997U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.498312.54835 ; sas11/sas10=2.501292.54835
Now doing the same, using Apply2Array and array-passing:
477895 times stats-test3 (ss10=7.991555.77694 ; sas10=3.996525.77694): 
	took 1.89709(real)/1.83000(user) sec [755728R/783435U]l/s seconds with $UseConstantsLists=0
477895 times stats-test4 (ss11=20.021414.7222 ; sas11=10.012414.7222): 
	took 3.21419(real)/3.13000(user) sec [446048R/458046U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.505322.54844 ; sas11/sas10=2.505282.54844
477895 times stats-test1 (ss10=7.991595.77651 ; sas10=3.995795.77651): 
	took 3.43411(real)/3.35000(user) sec [417483R/427966U]l/s seconds with $UseConstantsLists=1
477895 times stats-test2 (ss11=20.044814.7161 ; sas11=10.022914.7161): 
	took 4.93344(real)/4.85000(user) sec [290605R/295605U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.508242.54757 ; sas11/sas10=2.508352.54757
Now doing the same, using Apply2Array and array-passing:
477895 times stats-test3 (ss10=7.999985.76799 ; sas10=3.998665.76799): 
	took 1.89716(real)/1.87000(user) sec [755700R/766677U]l/s seconds with $UseConstantsLists=1
477895 times stats-test4 (ss11=20.029714.7179 ; sas11=10.017014.7179): 
	took 3.20588(real)/3.15000(user) sec [447206R/455138U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.503722.55165 ; sas11/sas10=2.505082.55165
expression-loops per second (61 samples):
	1.43368e+06/3.94851=363096 (real time)
	1.43368e+06/3.18639=449940 (user time)
