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 2>/dev/null >pipe:[19100]  ## sh/bash notation; escape as necessary!
 XGraph build version 20040124; gcc3.3.2[Jan 29 2004 20:00:05,"Linux bola 2.2.25 i686 unknown ; CC='gccopt -DXGRAPH ' ACC='gccopt -DXGRAPH '"]
 Executed d.d. Thu Jan 29 20:01:54 2004
 Input files: 'examples/benching.xg: Sun Jan 25 00:36:17 2004' 
 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.323242(real)/0.320000(user) sec [3.09366e+06R/3.12500e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.794725(real)/0.780000(user) sec [1.25830e+06R/1.28205e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 0.778476(real)/0.780000(user) sec [1.28456e+06R/1.28205e+06U]l/s seconds
Calibrating adapted loop size (should be 1s)... 1.28456e+06 times looping empty procedure took 0.999529(real)/0.990000(user) sec [1.28517e+06R/1.29754e+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.28456e+06] arrays in a scalar-addition loop, without support for simple array arithmetic: 5.62522(real)/5.59000(user) sec [228357R/229796U]l/s
	Result z==2  0
Addition of 2 [1.28456e+06] arrays in a scalar-addition loop, with support for simple array arithmetic: 5.96678(real)/5.95000(user) sec [215285R/215893U]l/s
	Result z==2  0
Addition of 2 [1.28456e+06] arrays with scalar-addition and Apply2Array, without support for simple array arithmetic: 3.11802(real)/3.11000(user) sec [411979R/413042U]l/s
	Result z==2  0
Addition of 2 [1.28456e+06] arrays with scalar-addition and Apply2Array, with support for simple array arithmetic: 3.55408(real)/3.53000(user) sec [361432R/363898U]l/s
	Result z==2  0
Addition of a scalar to a [1.28456e+06] array with scalar-addition, without support for simple array arithmetic: 5.29619(real)/5.28000(user) sec [242544R/243288U]l/s
	Result z==642281  370821
Addition of a scalar to a [1.28456e+06] array with scalar-addition, with support for simple array arithmetic: 5.63337(real)/5.61000(user) sec [228027R/228977U]l/s
	Result z==642281  370821
Addition of a scalar to a [1.28456e+06] array with scalar-addition and Apply2Array, without support for simple array arithmetic: 0.299328(real)/0.300000(user) sec [4.29148e+06R/4.28187e+06U]l/s
	Result z==642281  370821
Addition of a scalar to a [1.28456e+06] array with scalar-addition and Apply2Array, with support for simple array arithmetic: 0.628463(real)/0.620000(user) sec [2.04397e+06R/2.07187e+06U]l/s
	Result z==642281  370821
10x array[1.28456e+06] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 3.99478e-04(real)/0(user) sec [3.21559e+09R/InfU]l/s
	Result z==0  0
10x array[1.28456e+06] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 1.16528(real)/1.15000(user) sec [1.10236e+06R/1.11701e+06U]l/s
	Result z==2  0
1.28456e+06x array[10] addition with support for simple array arithmetic, array addition: 5.73254(real)/5.70000(user) sec [224082R/225362U]l/s
	Result zz==5.50000  3.02765
10x array[1.28456e+06] multiplication with support for simple array arithmetic, array addition (mul[&z,&x,&y]): 1.23003(real)/1.23000(user) sec [1.04433e+06R/1.04436e+06U]l/s
	Result z==1  0
1.28456e+06x array[10] multiplication with support for simple array arithmetic, array addition: 5.78840(real)/5.78000(user) sec [221920R/222242U]l/s
	Result zz==4.50000  3.02765
10x array[1.28456e+06] division with support for simple array arithmetic, array addition (div[&z,&x,&y]): 1.36583(real)/1.37000(user) sec [940501R/937635U]l/s
	Result z==1  0
1.28456e+06x array[10] division with support for simple array arithmetic, array addition: 6.09587(real)/6.09000(user) sec [210726R/210929U]l/s
	Result zz==4.50000  3.02765
procedure calling overhead compared to functions, $UseConstantsLists=1
1.28456e+06 times v1,v2: 0.776980(real)/0.780000(user) sec [1.65327e+06R/1.64687e+06U]l/s
1.28456e+06 times v1[v2],v2[v1]=120,120: 1.06156(real)/1.06000(user) sec [1.21007e+06R/1.21185e+06U]l/s
1.28456e+06 times v[0],v[1]: 1.58127(real)/1.58000(user) sec [812359R/813013U]l/s
1.28456e+06 times v[0,v1],v[1,v2]=100,120: 2.10403(real)/2.10000(user) sec [610525R/611695U]l/s
1.28456e+06 times v[0,v1,v2]=100,120: 2.25700(real)/2.26000(user) sec [569144R/568389U]l/s
1.28456e+06 times empty=0: 1.10684(real)/1.11000(user) sec [1.16056e+06R/1.15726e+06U]l/s
1.28456e+06 times empty[v1,v2]=0: 1.86577(real)/1.86000(user) sec [688488R/690624U]l/s
1.28456e+06 times add[v1,v2]=220: 2.59632(real)/2.59000(user) sec [494762R/495969U]l/s
1.28456e+06 times add[v[0],v[1]]=220: 3.22913(real)/3.23000(user) sec [397804R/397697U]l/s
1.28456e+06 times call[&add,v1,v2]=220: 3.05039(real)/3.04000(user) sec [421113R/422553U]l/s
1.28456e+06 times sumvv=220: 3.44369(real)/3.44000(user) sec [373019R/373419U]l/s
1.28456e+06 times sum[v1,v2]=220: 4.83104(real)/4.83000(user) sec [265897R/265955U]l/s
1.28456e+06 times call[&sum,v1,v2]=220: 7.36009(real)/7.36000(user) sec [174531R/174533U]l/s
1.28456e+06 times call[lambda[add[$[0],$[1]]],v1,v2]=220: 7.42144(real)/7.41000(user) sec [173088R/173355U]l/s
1.28456e+06 times sum[v1,ran]=100.688: 6.62561(real)/6.62000(user) sec [193878R/194042U]l/s
1.28456e+06 times call[&sum,v1,ran]=100.531->100.659: 10.1828(real)/10.1800(user) sec [126150R/126185U]l/s

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

1.28456e+06 times 2Dindex[1,2,3,4]: 3.36087(real)/3.36000(user) sec [382211R/382310U]l/s
1.28456e+06 times nDindex[1,2,3,4]: 3.78282(real)/3.77000(user) sec [339578R/340732U]l/s
1.28456e+06 times @[&zz,$loop]==-123.456: 3.37079(real)/3.37000(user) sec [381086R/381175U]l/s
1.28456e+06 times @[`"1234567890"]==2.12044e+10 3.21283(real)/3.22000(user) sec [399822R/398932U]l/s

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

1.28456e+06 times 'progn[2,add[2,kk]]' took 4.61732(real)/4.60000(user) sec [278205R/279252U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'progn[2,?add,?ran]' took 2.79727(real)/2.79000(user) sec [459219R/460416U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'progn[2,add[2,kk]]' took 4.46796(real)/4.46000(user) sec [287505R/288018U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'progn[2,?add,?ran]' took 2.69963(real)/2.69000(user) sec [475829R/477532U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'var[foo[?ran]]'=0.649292 took 4.16704(real)/4.16000(user) sec [308267R/308789U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'var[foo[?ran]]'=0.649292 took 1.33642(real)/1.33000(user) sec [961195R/965835U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'var'=0 took 0.889855(real)/0.890000(user) sec [1.44356e+06R/1.44333e+06U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'var'=0 took 0.669291(real)/0.670000(user) sec [1.91928e+06R/1.91725e+06U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'var[$loop]'=1.28456e+06 took 2.56274(real)/2.54000(user) sec [501246R/505732U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'var[$loop]'=1.28456e+06 took 0.811630(real)/0.810000(user) sec [1.58269e+06R/1.58588e+06U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'var[foo[$loop]]'=1.28456e+06 took 4.24268(real)/4.24000(user) sec [302771R/302962U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'var[foo[$loop]]'=1.28456e+06 took 1.32675(real)/1.33000(user) sec [968200R/965835U]l/s seconds with $UseConstantsLists=1
1.28456e+06 times 'var[foo[bar[$loop]]]'=1.28456e+06 took 5.90220(real)/5.89000(user) sec [217641R/218092U]l/s seconds with $UseConstantsLists=0
1.28456e+06 times 'var[foo[bar[$loop]]]'=1.28456e+06 took 3.03175(real)/3.03000(user) sec [423702R/423947U]l/s seconds with $UseConstantsLists=1
428186 times stats-test1 (ss10=7.996165.77846 ; sas10=3.998645.77846): 
	took 3.94201(real)/3.95000(user) sec [325864R/325205U]l/s seconds with $UseConstantsLists=0
428186 times stats-test2 (ss11=19.986214.7076 ; sas11=9.9967714.7076): 
	took 5.69427(real)/5.69000(user) sec [225588R/225758U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.499472.54526 ; sas11/sas10=2.500042.54526
Now doing the same, using Apply2Array and array-passing:
428186 times stats-test3 (ss10=8.003455.76421 ; sas10=4.000685.76421): 
	took 2.17530(real)/2.18000(user) sec [590522R/589248U]l/s seconds with $UseConstantsLists=0
428186 times stats-test4 (ss11=20.001514.7086 ; sas11=9.9925214.7086): 
	took 3.20152(real)/3.20000(user) sec [401234R/401425U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.499112.55172 ; sas11/sas10=2.497702.55172
428186 times stats-test1 (ss10=7.995485.76920 ; sas10=3.994675.76920): 
	took 3.93936(real)/3.94000(user) sec [326084R/326031U]l/s seconds with $UseConstantsLists=1
428186 times stats-test2 (ss11=19.990614.7165 ; sas11=9.9862914.7165): 
	took 5.68982(real)/5.69000(user) sec [225765R/225758U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.500242.55087 ; sas11/sas10=2.499902.55087
Now doing the same, using Apply2Array and array-passing:
428186 times stats-test3 (ss10=8.011975.77095 ; sas10=3.997355.77095): 
	took 2.17613(real)/2.16000(user) sec [590295R/594704U]l/s seconds with $UseConstantsLists=1
428186 times stats-test4 (ss11=20.037014.7123 ; sas11=10.021714.7123): 
	took 3.20314(real)/3.20000(user) sec [401032R/401425U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.500882.54938 ; sas11/sas10=2.507082.54938
expression-loops per second (61 samples):
	1.28456e+06/3.23215=397432 (real time)
	1.28456e+06/3.22607=398182 (user time)
