executing: time /usr/X11R6/bin/xgraph examples/benching.xg 2>/dev/null
Current file: examples/benching.xg: Sat Jan 24 23:36:16 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; gcc2.95[Mar 11 2004 20:19:40,"CYGWIN_95-4.0 MIRAGE 1.3.2(0.39/3/2) i586 ; CC='gccopt -DXGRAPH ' ACC='gccopt -DXGRAPH '"]
 Executed d.d. Thu Mar 11 20:30:50 2004
 Input files: 'examples/benching.xg: Sat Jan 24 23:36:16 2004' 
 Working directory: /home/bertin/work/src/xgraph
 Last opened on display bola:0.0/-1/-1 (visual 0x23, 24 planes TrueColor) by bertin


1.00000e+06 times empty loop took 0.940000(real)/0.906000(user) sec [1.06383e+06R/1.10375e+06U]l/s seconds
1.00000e+06 times looping empty procedure took 1.86000(real)/1.90900(user) sec [537635R/523835U]l/s seconds
1.00000e+06 times looping empty procedure took 1.81000(real)/1.85400(user) sec [552486R/539374U]l/s seconds
Calibrating adapted loop size (should be 1s)... 552486 times looping empty procedure took 1.05000(real)/0.990000(user) sec [526177R/558067U]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 [552486] arrays in a scalar-addition loop, without support for simple array arithmetic: 5.05000(real)/5.05300(user) sec [109403R/109338U]l/s
	Result z==2  0
Addition of 2 [552486] arrays in a scalar-addition loop, with support for simple array arithmetic: 5.60000(real)/5.60200(user) sec [98658.2R/98623.0U]l/s
	Result z==2  0
Addition of 2 [552486] arrays with scalar-addition and Apply2Array, without support for simple array arithmetic: 3.79000(real)/3.77700(user) sec [145775R/146277U]l/s
	Result z==2  0
Addition of 2 [552486] arrays with scalar-addition and Apply2Array, with support for simple array arithmetic: 4.18000(real)/4.20300(user) sec [132174R/131450U]l/s
	Result z==2  0
Addition of a scalar to a [552486] array with scalar-addition, without support for simple array arithmetic: 4.84000(real)/4.83400(user) sec [114150R/114292U]l/s
	Result z==276244  159489
Addition of a scalar to a [552486] array with scalar-addition, with support for simple array arithmetic: 5.33000(real)/5.30100(user) sec [103656R/104223U]l/s
	Result z==276244  159489
Addition of a scalar to a [552486] array with scalar-addition and Apply2Array, without support for simple array arithmetic: 0.390000(real)/0.397000(user) sec [1.41663e+06R/1.39165e+06U]l/s
	Result z==276244  159489
Addition of a scalar to a [552486] array with scalar-addition and Apply2Array, with support for simple array arithmetic: 0.600000(real)/0.605000(user) sec [920810R/913200U]l/s
	Result z==276244  159489
10x array[552486] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 0(real)/0(user) sec [InfR/InfU]l/s
	Result z==0  0
10x array[552486] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 1.43000(real)/1.39900(user) sec [386354R/394915U]l/s
	Result z==2  0
552486x array[10] addition with support for simple array arithmetic, array addition: 5.38000(real)/5.37000(user) sec [102693R/102884U]l/s
	Result zz==5.50000  3.02765
10x array[552486] multiplication with support for simple array arithmetic, array addition (mul[&z,&x,&y]): 1.43000(real)/1.44300(user) sec [386354R/382873U]l/s
	Result z==1  0
552486x array[10] multiplication with support for simple array arithmetic, array addition: 5.71000(real)/5.70000(user) sec [96757.6R/96927.4U]l/s
	Result zz==4.50000  3.02765
10x array[552486] division with support for simple array arithmetic, array addition (div[&z,&x,&y]): 1.49000(real)/1.49500(user) sec [370796R/369556U]l/s
	Result z==1  0
552486x array[10] division with support for simple array arithmetic, array addition: 5.60000(real)/5.58900(user) sec [98658.2R/98852.4U]l/s
	Result zz==4.50000  3.02765
procedure calling overhead compared to functions, $UseConstantsLists=1
552486 times v1,v2: 0.770000(real)/0.783000(user) sec [717514R/705602U]l/s
552486 times v1[v2],v2[v1]=120,120: 1.10000(real)/1.09900(user) sec [502260R/502717U]l/s
552486 times v[0],v[1]: 1.59000(real)/1.57900(user) sec [347476R/349896U]l/s
552486 times v[0,v1],v[1,v2]=100,120: 1.98000(real)/1.97800(user) sec [279033R/279316U]l/s
552486 times v[0,v1,v2]=100,120: 1.98000(real)/1.96400(user) sec [279033R/281307U]l/s
552486 times empty=0: 1.04000(real)/1.05700(user) sec [531237R/522693U]l/s
552486 times empty[v1,v2]=0: 1.70000(real)/1.67600(user) sec [324992R/329646U]l/s
552486 times add[v1,v2]=220: 2.42000(real)/2.43100(user) sec [228300R/227267U]l/s
552486 times add[v[0],v[1]]=220: 2.97000(real)/2.92600(user) sec [186022R/188820U]l/s
552486 times call[&add,v1,v2]=220: 2.69000(real)/2.73300(user) sec [205385R/202154U]l/s
552486 times sumvv=220: 4.23000(real)/4.17500(user) sec [130611R/132332U]l/s
552486 times sum[v1,v2]=220: 5.71000(real)/5.72600(user) sec [96757.6R/96487.3U]l/s
552486 times call[&sum,v1,v2]=220: 8.84000(real)/8.85800(user) sec [62498.4R/62371.4U]l/s
552486 times call[lambda[add[$[0],$[1]]],v1,v2]=220: 8.84000(real)/8.85800(user) sec [62498.4R/62371.4U]l/s
552486 times sum[v1,ran]=100.750: 8.62000(real)/8.61100(user) sec [64093.5R/64160.5U]l/s
552486 times call[&sum,v1,ran]=100.308->100.118: 13.0800(real)/13.1010(user) sec [42239.0R/42171.3U]l/s

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

552486 times 2Dindex[1,2,3,4]: 2.91000(real)/2.93900(user) sec [189858R/187984U]l/s
552486 times nDindex[1,2,3,4]: 3.18000(real)/3.14500(user) sec [173738R/175671U]l/s
552486 times @[&zz,$loop]==-123.456: 3.13000(real)/3.15900(user) sec [176513R/174893U]l/s
552486 times @[`"1234567890"]==2.12044e+10 2.86000(real)/2.83100(user) sec [193177R/195156U]l/s

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

552486 times 'progn[2,add[2,kk]]' took 4.23000(real)/4.21600(user) sec [130611R/131045U]l/s seconds with $UseConstantsLists=0
552486 times 'progn[2,?add,?ran]' took 2.64000(real)/2.63700(user) sec [209275R/209513U]l/s seconds with $UseConstantsLists=0
552486 times 'progn[2,add[2,kk]]' took 4.07000(real)/4.05200(user) sec [135746R/136349U]l/s seconds with $UseConstantsLists=1
552486 times 'progn[2,?add,?ran]' took 2.85000(real)/2.85600(user) sec [193855R/193448U]l/s seconds with $UseConstantsLists=1
552486 times 'var[foo[?ran]]'=0.936867 took 4.06000(real)/4.10600(user) sec [136080R/134556U]l/s seconds with $UseConstantsLists=0
552486 times 'var[foo[?ran]]'=0.936867 took 1.37000(real)/1.38700(user) sec [403275R/398332U]l/s seconds with $UseConstantsLists=1
552486 times 'var'=0 took 1.05000(real)/1.05700(user) sec [526177R/522693U]l/s seconds with $UseConstantsLists=0
552486 times 'var'=0 took 0.820000(real)/0.825000(user) sec [673764R/669680U]l/s seconds with $UseConstantsLists=1
552486 times 'var[$loop]'=552485 took 2.59000(real)/2.55400(user) sec [213315R/216322U]l/s seconds with $UseConstantsLists=0
552486 times 'var[$loop]'=552485 took 0.930000(real)/0.893000(user) sec [594071R/618685U]l/s seconds with $UseConstantsLists=1
552486 times 'var[foo[$loop]]'=552485 took 3.73000(real)/3.72100(user) sec [148120R/148478U]l/s seconds with $UseConstantsLists=0
552486 times 'var[foo[$loop]]'=552485 took 1.15000(real)/1.19400(user) sec [480423R/462719U]l/s seconds with $UseConstantsLists=1
552486 times 'var[foo[bar[$loop]]]'=552485 took 5.16000(real)/5.14900(user) sec [107071R/107300U]l/s seconds with $UseConstantsLists=0
552486 times 'var[foo[bar[$loop]]]'=552485 took 2.58000(real)/2.59500(user) sec [214142R/212904U]l/s seconds with $UseConstantsLists=1
184162 times stats-test1 (ss10=7.985875.76870 ; sas10=3.994665.76870): 
	took 4.28000(real)/4.28500(user) sec [129086R/128935U]l/s seconds with $UseConstantsLists=0
184162 times stats-test2 (ss11=19.951614.7091 ; sas11=9.9858914.7091): 
	took 5.99000(real)/5.96000(user) sec [92234.7R/92699.0U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.498362.54981 ; sas11/sas10=2.499812.54981
Now doing the same, using Apply2Array and array-passing:
184162 times stats-test3 (ss10=8.005485.77780 ; sas10=4.006475.77780): 
	took 2.85000(real)/2.85600(user) sec [193855R/193448U]l/s seconds with $UseConstantsLists=0
184162 times stats-test4 (ss11=20.001714.7083 ; sas11=9.9980714.7083): 
	took 4.01000(real)/4.03800(user) sec [137777R/136822U]l/s seconds with $UseConstantsLists=0
Ratios (should be 2.5): ss11/ss10=2.498512.54566 ; sas11/sas10=2.495482.54566
184162 times stats-test1 (ss10=8.011715.77627 ; sas10=4.006695.77627): 
	took 4.45000(real)/4.46300(user) sec [124154R/123793U]l/s seconds with $UseConstantsLists=1
184162 times stats-test2 (ss11=19.985614.7064 ; sas11=9.9961314.7064): 
	took 5.87000(real)/5.90500(user) sec [94120.3R/93562.4U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.494552.54600 ; sas11/sas10=2.494862.54600
Now doing the same, using Apply2Array and array-passing:
184162 times stats-test3 (ss10=7.978115.76803 ; sas10=3.986595.76803): 
	took 2.86000(real)/2.85800(user) sec [193177R/193312U]l/s seconds with $UseConstantsLists=1
184162 times stats-test4 (ss11=19.999214.7249 ; sas11=9.9961814.7249): 
	took 4.01000(real)/4.01000(user) sec [137777R/137777U]l/s seconds with $UseConstantsLists=1
Ratios (should be 2.5): ss11/ss10=2.506752.55284 ; sas11/sas10=2.507452.55284
expression-loops per second (61 samples):
	552486/3.40443=162285 (real time)
	552486/3.40448=162282 (user time)

Real: 3m42.060s
