Current file: examples/benching.xg: Thu Apr 11 19:18:41 2002
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 gcc[Apr 11 2002 19:10:53], version 200204011
 Executed d.d. Thu Apr 11 19:21:28 2002
 Input files: 'examples/benching.xg' 
 Working directory: /home/bertin/work/src/xgraph
 Last opened on display :0.0/-1/-1 (visual 0x24, 16 planes TrueColor) by bertin


1000000 times empty loop took 0.4684430000000000538(real)/0.4500000000000000111(user) seconds
Calibrating adapted loop size (should be 0.5s)... 1067365 times empty loop took 0.49797200000000002573(real)/0.47999999999999998224(user) 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 [1067365] arrays in a scalar-addition loop, without support for simple array arithmetic: 6.3072809999999996933(real)/6.2900000000000000355(user)s
Addition of 2 [1067365] arrays in a scalar-addition loop, with support for simple array arithmetic: 6.3781559999999997146(real)/6.3600000000000003197(user)s
10x array[1067365] addition without support for simple array arithmetic, array addition (add[&z,&x,&y]): 0.020713999999999999774(real)/0(user)s
10x array[1067365] addition with support for simple array arithmetic, array addition (add[&z,&x,&y]): 0.91084799999999999098(real)/0.89000000000000001332(user)s

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

1067365 times 2Dindex[1,2,3,4]: 2.6651159999999998185(real)/2.6499999999999999112(user)s
1067365 times nDindex[1,2,3,4]: 2.9401640000000002217(real)/2.9199999999999999289(user)s

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

1067365 times 'progn[2,add[2,kk]]' took 3.6749149999999999316(real)/3.6600000000000001421(user) seconds with $UseConstantsLists=0
1067365 times 'progn[2,?add,?ran]' took 2.2509969999999999146(real)/2.2299999999999999822(user) seconds with $UseConstantsLists=0
1067365 times 'progn[2,add[2,kk]]' took 3.5707010000000001249(real)/3.5600000000000000533(user) seconds with $UseConstantsLists=1
1067365 times 'progn[2,?add,?ran]' took 2.0088219999999998855(real)/1.9899999999999999911(user) seconds with $UseConstantsLists=1
1067365 times 'var[foo[?ran]]'=0.1766426425429159508 took 3.1872539999999998095(real)/3.1699999999999999289(user) seconds with $UseConstantsLists=0
1067365 times 'var[foo[?ran]]'=0.1766426425429159508 took 1.8934310000000000862(real)/1.8700000000000001066(user) seconds with $UseConstantsLists=1
1067365 times 'var'=0 took 0.81048699999999995747(real)/0.79000000000000003553(user) seconds with $UseConstantsLists=0
1067365 times 'var'=0 took 0.81155399999999999761(real)/0.79000000000000003553(user) seconds with $UseConstantsLists=1
1067365 times 'var[$loop]'=1067364 took 2.0003479999999997929(real)/1.9799999999999999822(user) seconds with $UseConstantsLists=0
1067365 times 'var[$loop]'=1067364 took 1.7534399999999998876(real)/1.7399999999999999911(user) seconds with $UseConstantsLists=1
1067365 times 'var[foo[$loop]]'=1067364 took 3.2083990000000000009(real)/3.1899999999999999467(user) seconds with $UseConstantsLists=0
1067365 times 'var[foo[$loop]]'=1067364 took 1.8948369999999998825(real)/1.8799999999999998934(user) seconds with $UseConstantsLists=1
1067365 times 'var[foo[bar[$loop]]]'=1067364 took 4.4024250000000000327(real)/4.3899999999999996803(user) seconds with $UseConstantsLists=0
1067365 times 'var[foo[bar[$loop]]]'=1067364 took 3.1120390000000002217(real)/3.0899999999999998579(user) seconds with $UseConstantsLists=1
