executing: time xgraph examples/benching.xg 2>/dev/null
Current file: examples/benching.xg: Thu Mar 11 20:48:54 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 2>/dev/null >pipe:[173727]  ## sh/bash notation; escape as necessary!
 XGraph build version 20040311; gcc3.3.3[Mar 11 2004 20:46:02,"Linux irancy 2.4.20-irancy i686 ; CC='gccopt -DXGRAPH ' ACC='gccopt -DXGRAPH '"]
 Executed d.d. Thu Mar 11 20:48:58 2004
 Input files: 'examples/benching.xg: Thu Mar 11 20:48:54 2004' 
 Working directory: /home/bertin/work/src/xgraph
 Last opened on display localhost:10.0/-1/-1 (visual 0x23, 24 planes TrueColor) by bertin


1.00000e+06 times empty loop took 0.115904(real)/0.120000(user) sec [8.62784e+06R/8.33333e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.264373(real)/0.260000(user) sec [3.78254e+06R/3.84615e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.261620(real)/0.260000(user) sec [3.82234e+06R/3.84615e+06U]l/s seconds
Calibrating adapted loop size (should be 1s)... 3.82234e+06 times looping empty procedure took 0.987532(real)/0.980000(user) sec [3.87060e+06R/3.90035e+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 [3.82234e+06] arrays in a scalar-addition loop, without support for simple array arithmetic: 3.90921(real)/3.91000(user) sec [977779R/977581U]l/s
	Result z==2  0
Addition of 2 [3.82234e+06] arrays in a scalar-addition loop, with support for simple array arithmetic: 4.17272(real)/4.18000(user) sec [916031R/914436U]l/s
	Result z==2  0
Addition of 2 [3.82234e+06] arrays with scalar-addition and Apply2Array, without support for simple array arithmetic: 2.08144(real)/2.08000(user) sec [1.83639e+06R/1.83766e+06U]l/s
	Result z==2  0
Addition of 2 [3.82234e+06] arrays with scalar-addition and Apply2Array, with support for simple array arithmetic: 2.30660(real)/2.31000(user) sec [1.65713e+06R/1.65469e+06U]l/s
	Result z==2  0
Addition of a scalar to a [3.82234e+06] array with scalar-addition, without support for simple array arithmetic: 3.79150(real)/3.79000(user) sec [1.00813e+06R/1.00853e+06U]l/s
	Result z==1.91117e+06  1.10341e+06
Addition of a scalar to a [3.82234e+06] array with scalar-addition, with support for simple array arithmetic: 4.04638(real)/4.04000(user) sec [944632R/946124U]l/s
	Result z==1.91117e+06  1.10341e+06
Addition of a scalar to a [3.82234e+06] array with scalar-addition and Apply2Array, without support for simple array arithmetic: 0.196847(real)/0.200000(user) sec [1.94178e+07R/1.91117e+07U]l/s
	Result z==1.91117e+06  1.10341e+06
Addition of a scalar to a [3.82234e+06] array with scalar-addition and Apply2Array, with support for simple array arithmetic: 0.515032(real)/0.520000(user) sec [7.42156e+06R/7.35065e+06U]l/s
	Result z==1.91117e+06  1.10341e+06
10x array[3.82234e+06] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 1.43763e-04(real)/0(user) sec [2.65879e+10R/InfU]l/s
	Result z==0  0
10x array[3.82234e+06] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 0.747268(real)/0.750000(user) sec [5.11509e+06R/5.09645e+06U]l/s
	Result z==2  0
3.82234e+06x array[10] addition with support for simple array arithmetic, array addition: 4.07522(real)/4.07000(user) sec [937947R/939150U]l/s
	Result zz==5.50000  3.02765
10x array[3.82234e+06] multiplication with support for simple array arithmetic, array addition (mul[&z,&x,&y]): 0.747353(real)/0.740000(user) sec [5.11450e+06R/5.16532e+06U]l/s
	Result z==1  0
3.82234e+06x array[10] multiplication with support for simple array arithmetic, array addition: 4.22612(real)/4.23000(user) sec [904457R/903627U]l/s
	Result zz==4.50000  3.02765
10x array[3.82234e+06] division with support for simple array arithmetic, array addition (div[&z,&x,&y]): 0.798302(real)/0.800000(user) sec [4.78809e+06R/4.77792e+06U]l/s
	Result z==1  0
3.82234e+06x array[10] division with support for simple array arithmetic, array addition: 4.37595(real)/4.38000(user) sec [873488R/872680U]l/s
	Result zz==4.50000  3.02765
procedure calling overhead compared to functions, $UseConstantsLists=1
3.82234e+06 times v1,v2: 0.637306(real)/0.640000(user) sec [5.99765e+06R/5.97241e+06U]l/s
3.82234e+06 times v1[v2],v2[v1]=120,120: 0.901460(real)/0.900000(user) sec [4.24017e+06R/4.24704e+06U]l/s
3.82234e+06 times v[0],v[1]: 0.861102(real)/0.870000(user) sec [4.43889e+06R/4.39349e+06U]l/s
3.82234e+06 times v[0,v1],v[1,v2]=100,120: 1.33748(real)/1.33000(user) sec [2.85786e+06R/2.87394e+06U]l/s
3.82234e+06 times v[0,v1,v2]=100,120: 1.36963(real)/1.37000(user) sec [2.79078e+06R/2.79003e+06U]l/s
3.82234e+06 times empty=0: 1.04212(real)/1.05000(user) sec [3.66785e+06R/3.64032e+06U]l/s
3.82234e+06 times empty[v1,v2]=0: 1.68240(real)/1.68000(user) sec [2.27196e+06R/2.27520e+06U]l/s
3.82234e+06 times add[v1,v2]=220: 2.07205(real)/2.07000(user) sec [1.84471e+06R/1.84654e+06U]l/s
3.82234e+06 times add[v[0],v[1]]=220: 2.29009(real)/2.29000(user) sec [1.66908e+06R/1.66914e+06U]l/s
3.82234e+06 times call[&add,v1,v2]=220: 2.52912(real)/2.53000(user) sec [1.51133e+06R/1.51081e+06U]l/s
3.82234e+06 times sumvv=220: 2.79290(real)/2.77000(user) sec [1.36859e+06R/1.37991e+06U]l/s
3.82234e+06 times sum[v1,v2]=220: 3.57246(real)/3.58000(user) sec [1.06995e+06R/1.06769e+06U]l/s
3.82234e+06 times call[&sum,v1,v2]=220: 5.08543(real)/5.08000(user) sec [751626R/752429U]l/s
3.82234e+06 times call[lambda[add[$[0],$[1]]],v1,v2]=220: 5.07565(real)/5.08000(user) sec [753075R/752429U]l/s
3.82234e+06 times sum[v1,ran]=100.546: 4.52485(real)/4.52000(user) sec [844745R/845651U]l/s
3.82234e+06 times call[&sum,v1,ran]=100.502->100.804: 6.12256(real)/6.13000(user) sec [624304R/623547U]l/s

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

3.82234e+06 times 2Dindex[1,2,3,4]: 2.31407(real)/2.32000(user) sec [1.65178e+06R/1.64756e+06U]l/s
3.82234e+06 times nDindex[1,2,3,4]: 2.52432(real)/2.52000(user) sec [1.51420e+06R/1.51680e+06U]l/s
3.82234e+06 times @[&zz,$loop]==-123.456: 2.57741(real)/2.58000(user) sec [1.48302e+06R/1.48153e+06U]l/s
3.82234e+06 times @[`"1234567890"]==2.12044e+10 2.88413(real)/2.88000(user) sec [1.32530e+06R/1.32720e+06U]l/s

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

3.82234e+06 times 'progn[2,add[2,kk]]' took 3.82326(real)/3.83000(user) sec [999760R/998000U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'progn[2,?add,?ran]' took 2.32056(real)/2.32000(user) sec [1.64716e+06R/1.64756e+06U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'progn[2,add[2,kk]]' took 3.52444(real)/3.53000(user) sec [1.08452e+06R/1.08282e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'progn[2,?add,?ran]' took 2.09538(real)/2.09000(user) sec [1.82417e+06R/1.82887e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'var[foo[?ran]]'=0.562508 took 3.51891(real)/3.52000(user) sec [1.08623e+06R/1.08589e+06U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'var[foo[?ran]]'=0.562508 took 1.07426(real)/1.08000(user) sec [3.55812e+06R/3.53920e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'var'=0 took 0.785151(real)/0.780000(user) sec [4.86829e+06R/4.90044e+06U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'var'=0 took 0.567195(real)/0.560000(user) sec [6.73903e+06R/6.82561e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'var[$loop]'=3.82234e+06 took 2.18007(real)/2.18000(user) sec [1.75331e+06R/1.75337e+06U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'var[$loop]'=3.82234e+06 took 0.639804(real)/0.630000(user) sec [5.97423e+06R/6.06721e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'var[foo[$loop]]'=3.82234e+06 took 3.54021(real)/3.54000(user) sec [1.07969e+06R/1.07976e+06U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'var[foo[$loop]]'=3.82234e+06 took 1.03083(real)/1.03000(user) sec [3.70801e+06R/3.71101e+06U]l/s seconds with $UseConstantsLists=1
3.82234e+06 times 'var[foo[bar[$loop]]]'=3.82234e+06 took 5.08834(real)/5.09000(user) sec [751196R/750951U]l/s seconds with $UseConstantsLists=0
3.82234e+06 times 'var[foo[bar[$loop]]]'=3.82234e+06 took 2.49878(real)/2.50000(user) sec [1.52968e+06R/1.52894e+06U]l/s seconds with $UseConstantsLists=1
1.27411e+06 times stats-test1 (ss10=8.002935.77277 ; sas10=3.999045.77277): 
	took 3.87571(real)/3.88000(user) sec [986231R/985139U]l/s seconds with $UseConstantsLists=0
1.27411e+06 times stats-test2 (ss11=20.016214.7192 ; sas11=10.007414.7192): 
	took 4.52261(real)/4.52000(user) sec [845162R/845651U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.501112.54977 ; sas11/sas10=2.502452.54977
Now doing the same, using Apply2Array and array-passing:
1.27411e+06 times stats-test3 (ss10=7.998955.77313 ; sas10=3.999385.77313): 
	took 2.37217(real)/2.37000(user) sec [1.61132e+06R/1.61280e+06U]l/s seconds with $UseConstantsLists=0
1.27411e+06 times stats-test4 (ss11=20.003614.7043 ; sas11=9.9958114.7043): 
	took 3.47232(real)/3.47000(user) sec [1.10080e+06R/1.10154e+06U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.500782.54703 ; sas11/sas10=2.499342.54703
1.27411e+06 times stats-test1 (ss10=8.000505.77367 ; sas10=4.001355.77367): 
	took 3.84875(real)/3.85000(user) sec [993139R/992816U]l/s seconds with $UseConstantsLists=1
1.27411e+06 times stats-test2 (ss11=19.996614.7082 ; sas11=9.9934914.7082): 
	took 4.60943(real)/4.61000(user) sec [829243R/829141U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.499422.54746 ; sas11/sas10=2.497532.54746
Now doing the same, using Apply2Array and array-passing:
1.27411e+06 times stats-test3 (ss10=8.002085.77412 ; sas10=4.000115.77412): 
	took 2.36013(real)/2.36000(user) sec [1.61955e+06R/1.61964e+06U]l/s seconds with $UseConstantsLists=1
1.27411e+06 times stats-test4 (ss11=20.010914.7178 ; sas11=10.005514.7178): 
	took 3.47544(real)/3.47000(user) sec [1.09982e+06R/1.10154e+06U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.500722.54892 ; sas11/sas10=2.501312.54892
expression-loops per second (61 samples):
	3.82234e+06/2.47606=1.54372e+06 (real time)
	3.82234e+06/2.47574=1.54392e+06 (user time)

155.290 user_cpu 0.260 kernel_cpu 2:36.18 total_time 99.5%CPU {0W 0X 0D 0K 0M 1074F 32856R 0I 0O 0r 0s 0k 0w 0c}

