Current file: examples/benching.xg: Fri Oct 24 17:55:12 2003
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 2>/home/bertin/work/src/xgraph/kk.err >pipe:[2240]  ## sh/bash notation; escape as necessary!
 XGraph build version 20031228; gcc3.2.2[Dec 29 2003 12:23:57,"Linux bola 2.2.25 i686 unknown ; CC='gccopt -DXGRAPH ' ACC='gccopt -compiler gcc295.3 -inline -DXGRAPH '"]
 Executed d.d. Mon Dec 29 22:55:11 2003
 Input files: 'examples/benching.xg: Fri Oct 24 17:55:12 2003' 
 Working directory: /home/bertin/work/src/xgraph
 Last opened on display :0.0/-1/-1 (visual 0x23, 24 planes TrueColor) by bertin


1.00000e+06 times empty loop took 0.347954(real)/0.350000(user) sec [2.87394e+06R/2.85714e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.751433(real)/0.730000(user) sec [1.33079e+06R/1.36986e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.739105(real)/0.740000(user) sec [1.35299e+06R/1.35135e+06U]l/s seconds
Calibrating adapted loop size (should be 1s)... 1.35299e+06 times looping empty procedure took 1.03228(real)/1.03000(user) sec [1.31068e+06R/1.31358e+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 under 1s (meaning that the array
addition is some 60x faster than the looped scalar addition).

Addition of 2 [1.35299e+06] arrays in a scalar-addition loop, without support for simple array arithmetic: 5.75016(real)/5.74000(user) sec [235296R/235712U]l/s
	Result z==2  0
Addition of 2 [1.35299e+06] arrays in a scalar-addition loop, with support for simple array arithmetic: 6.40363(real)/6.40000(user) sec [211285R/211404U]l/s
	Result z==2  0
Addition of 2 [1.35299e+06] arrays with scalar-addition and Apply2Array, without support for simple array arithmetic: 3.31582(real)/3.31000(user) sec [408040R/408758U]l/s
	Result z==2  0
Addition of 2 [1.35299e+06] arrays with scalar-addition and Apply2Array, with support for simple array arithmetic: 3.62592(real)/3.62000(user) sec [373144R/373754U]l/s
	Result z==2  0
Addition of a scalar to a [1.35299e+06] array with scalar-addition, without support for simple array arithmetic: 5.40225(real)/5.40000(user) sec [250449R/250553U]l/s
	Result z==676495  390574
Addition of a scalar to a [1.35299e+06] array with scalar-addition, with support for simple array arithmetic: 6.03428(real)/6.03000(user) sec [224217R/224376U]l/s
	Result z==676495  390574
Addition of a scalar to a [1.35299e+06] array with scalar-addition and Apply2Array, without support for simple array arithmetic: 0.395170(real)/0.390000(user) sec [3.42382e+06R/3.46920e+06U]l/s
	Result z==676495  390574
Addition of a scalar to a [1.35299e+06] array with scalar-addition and Apply2Array, with support for simple array arithmetic: 0.707542(real)/0.710000(user) sec [1.91224e+06R/1.90562e+06U]l/s
	Result z==676495  390574
10x array[1.35299e+06] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 4.52603e-04(real)/0(user) sec [2.98935e+09R/InfU]l/s
	Result z==0  0
10x array[1.35299e+06] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 1.37574(real)/1.38000(user) sec [983464R/980426U]l/s
	Result z==2  0
1.35299e+06x array[10] addition with support for simple array arithmetic, array addition: 6.39578(real)/6.39000(user) sec [211544R/211735U]l/s
	Result zz==5.50000  3.02765
procedure calling overhead compared to functions, $UseConstantsLists=1
1.35299e+06 times v1,v2: 0.858620(real)/0.860000(user) sec [1.57577e+06R/1.57324e+06U]l/s
1.35299e+06 times v1[v2],v2[v1]=120,120: 1.22859(real)/1.23000(user) sec [1.10126e+06R/1.09999e+06U]l/s
1.35299e+06 times v[0],v[1]: 1.86356(real)/1.87000(user) sec [726024R/723523U]l/s
1.35299e+06 times v[0,v1],v[1,v2]=100,120: 2.39035(real)/2.39000(user) sec [566022R/566104U]l/s
1.35299e+06 times v[0,v1,v2]=100,120: 2.30998(real)/2.31000(user) sec [585716R/585709U]l/s
1.35299e+06 times empty=0: 1.09026(real)/1.09000(user) sec [1.24098e+06R/1.24127e+06U]l/s
1.35299e+06 times empty[v1,v2]=0: 1.88594(real)/1.89000(user) sec [717410R/715867U]l/s
1.35299e+06 times add[v1,v2]=220: 2.63223(real)/2.63000(user) sec [514009R/514444U]l/s
1.35299e+06 times add[v[0],v[1]]=220: 3.26050(real)/3.26000(user) sec [414964R/415027U]l/s
1.35299e+06 times call[&add,v1,v2]=220: 3.18609(real)/3.18000(user) sec [424655R/425468U]l/s
1.35299e+06 times sumvv=220: 3.45196(real)/3.45000(user) sec [391947R/392171U]l/s
1.35299e+06 times sum[v1,v2]=220: 5.04071(real)/5.02000(user) sec [268412R/269520U]l/s
1.35299e+06 times call[&sum,v1,v2]=220: 7.84807(real)/7.85000(user) sec [172398R/172355U]l/s
1.35299e+06 times call[lambda[add[$[0],$[1]]],v1,v2]=220: 7.83310(real)/7.80000(user) sec [172727R/173460U]l/s
1.35299e+06 times sum[v1,ran]=100.869: 6.61978(real)/6.62000(user) sec [204386R/204379U]l/s
1.35299e+06 times call[&sum,v1,ran]=100.586->100.776: 9.90778(real)/9.90000(user) sec [136558R/136666U]l/s

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

1.35299e+06 times 2Dindex[1,2,3,4]: 3.53931(real)/3.54000(user) sec [382274R/382200U]l/s
1.35299e+06 times nDindex[1,2,3,4]: 3.72474(real)/3.72000(user) sec [363244R/363707U]l/s
1.35299e+06 times @[&zz,$loop]==-123.456: 3.35546(real)/3.36000(user) sec [403221R/402675U]l/s
1.35299e+06 times @[`"1234567890"]==2.12044e+10 3.21397(real)/3.21000(user) sec [420972R/421492U]l/s

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

1.35299e+06 times 'progn[2,add[2,kk]]' took 4.76677(real)/4.76000(user) sec [283838R/284241U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'progn[2,?add,?ran]' took 2.86575(real)/2.87000(user) sec [472124R/471424U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'progn[2,add[2,kk]]' took 4.54081(real)/4.54000(user) sec [297962R/298015U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'progn[2,?add,?ran]' took 2.67922(real)/2.68000(user) sec [504993R/504846U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'var[foo[?ran]]'=0.625121 took 4.07199(real)/4.07000(user) sec [332267R/332430U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'var[foo[?ran]]'=0.625121 took 1.33596(real)/1.33000(user) sec [1.01275e+06R/1.01728e+06U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'var'=0 took 1.01917(real)/1.02000(user) sec [1.32754e+06R/1.32646e+06U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'var'=0 took 0.777863(real)/0.780000(user) sec [1.73937e+06R/1.73460e+06U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'var[$loop]'=1.35299e+06 took 2.58717(real)/2.58000(user) sec [522962R/524414U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'var[$loop]'=1.35299e+06 took 0.968577(real)/0.970000(user) sec [1.39688e+06R/1.39483e+06U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'var[foo[$loop]]'=1.35299e+06 took 4.10860(real)/4.10000(user) sec [329306R/329997U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'var[foo[$loop]]'=1.35299e+06 took 1.33600(real)/1.33000(user) sec [1.01272e+06R/1.01728e+06U]l/s seconds with $UseConstantsLists=1
1.35299e+06 times 'var[foo[bar[$loop]]]'=1.35299e+06 took 5.73475(real)/5.73000(user) sec [235928R/236124U]l/s seconds with $UseConstantsLists=0
1.35299e+06 times 'var[foo[bar[$loop]]]'=1.35299e+06 took 3.16168(real)/3.15000(user) sec [427934R/429520U]l/s seconds with $UseConstantsLists=1
450996 times stats-test1 (ss10=8.000895.77555 ; sas10=4.001715.77555): 
	took 3.81304(real)/3.81000(user) sec [354832R/355115U]l/s seconds with $UseConstantsLists=0
450996 times stats-test2 (ss11=19.971814.7016 ; sas11=9.9853614.7016): 
	took 5.65361(real)/5.63000(user) sec [239314R/240318U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.496202.54549 ; sas11/sas10=2.495272.54549
Now doing the same, using Apply2Array and array-passing:
450996 times stats-test3 (ss10=8.003235.77196 ; sas10=4.003085.77196): 
	took 2.29600(real)/2.29000(user) sec [589281R/590825U]l/s seconds with $UseConstantsLists=0
450996 times stats-test4 (ss11=20.008714.7140 ; sas11=9.9968714.7140): 
	took 3.34763(real)/3.32000(user) sec [404164R/407527U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.500082.54921 ; sas11/sas10=2.497292.54921
450996 times stats-test1 (ss10=8.002595.77289 ; sas10=4.000495.77289): 
	took 3.81200(real)/3.81000(user) sec [354929R/355115U]l/s seconds with $UseConstantsLists=1
450996 times stats-test2 (ss11=20.003914.7165 ; sas11=9.9927614.7165): 
	took 5.65308(real)/5.64000(user) sec [239336R/239892U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.499682.54924 ; sas11/sas10=2.497892.54924
Now doing the same, using Apply2Array and array-passing:
450996 times stats-test3 (ss10=8.006065.77566 ; sas10=4.002915.77566): 
	took 2.28798(real)/2.28000(user) sec [591346R/593416U]l/s seconds with $UseConstantsLists=1
450996 times stats-test4 (ss11=19.994314.7051 ; sas11=9.9927814.7051): 
	took 3.33049(real)/3.32000(user) sec [406243R/407527U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.497402.54604 ; sas11/sas10=2.496382.54604
expression-loops per second (57 samples):
	1.35299e+06/3.29240=410943 (real time)
	1.35299e+06/3.28790=411506 (user time)
