View Full Version : I need some speed tests
ErosOlmi
11-01-2008, 00:09
Hi all.
If you have some spare time and would like to test attached experimental thinCore.dll ...
I have done some code tuning and would like to know if notice any speed improvements and possibly no GPF.
IMPORTANT: to test attached thinCore.dll you need thinBasic 1.6.0.x installed.
To test, just download attached thinCore.dll and substitute the one present in \thinBasic\ directory.
Waiting for some tests.
Thanks a lot
Eros
PS: attached file removed.
Eros, I don't see any speed testing scripts? I know we had some test scripts, but can't remember what they were called or where they are.... are we supposed to use those?
sandyrepope
11-01-2008, 04:11
Are you talking about the ones under samplescripts/general/speed?
Sandy
Thanks Sandy, my memory is terrible at times.
With Sandy's help I found and ran the bench em all batch file.
Before: After:
Speed Test Loops: FOR, ..................... 93.000000 ............... 110.000000
Speed Test Loops: WHILE, .................. 141.000000 ............... 140.000000
Speed Test Loops: DO WHILE, ............. 125.000000 ............... 156.000000
Speed Test Loops: DO UNTIL, .............. 500.000000 ............... 547.000000
Speed Test Loops: TOTAL, 0.000000
Test Speed Count One Million, .............. 0.265000 .................. 0.265000
Test Speed CountOneMillion No Function, 0.266000 .................. 0.281000
Test Speed One Million SIN COS, .......... 1.062000 .................. 1.078000
Test Speed 2, ................................... 172.000000 ............... 187.000000
Test Speed 2 Function , ...................... 0.218000 .................. 0.234000
Before After
Speed2 Function MultiParams vs SingleUDT 3 params BYVAL, ...... 1.078000 ..... 1.110000
Speed2 Function MultiParams vs SingleUDT 3 params BYREF, ...... 1.016000 ..... 1.015000
Speed2 Function MultiParams vs SingleUDT UDT with 3 elements,. 0.593000 ..... 0.610000
Speed2 Function MultiParams vs SingleUDT function no params, .. 0.235000 ..... 0.250000
Test Speed 2 Function with Locals, ........................................ 0.765000 .... 0.797000
Speed2 Function With Params, .............................................. 0.687000 .... 0.703000
Test Speed 2 Typed, .......................................................... 281.000000 329.000000
It looks like I am slower now on many more things.
ErosOlmi
11-01-2008, 08:33
ok, perfect, thanks a lot
It seems I wasted my time :-\
Petr Schreiber
11-01-2008, 11:39
Eros,
hold on :)
All speed test scripts use TIMER or GetTickCount functions - they are good for not high precison stuff, but for benchmarks QueryPerformanceCounter is the only way!
I am rewriting all samples now, maybe it will show new version slower again, but we cannot continue to rely on TIMER based benchmarks ;)
Stay tuned, I will post testing set later today.
Thanks,
Petr
ErosOlmi
11-01-2008, 12:50
Thanks a lot Petr but consider that when I work on optimization I want it "visible".
I mean few millisecs are not worth the change. I'm in search of optimizations that perform at least 10% faster on regular basis (repeated tests always giving the same results and confirmed by other users).
I posted this version because I was checking this post: http://forum.basicprogramming.org/index.php?topic=51.0
I than created a test script and first run of two level nested empty FOR took 12 secs on my box to perform the 100000*1000 loops (10 millions).
I worked a bit on FOR and NEXT thinBasic implementation especially for FOR/NEXT where the control variable is of LONG type and comes with the attached thinCore version that in my box takes 8 secs to perform now. So, sensible gain but on big numbers (10 millions loop).
I'm now working more on variable assignment, especially on strings because I'm never done too much on string assignment and I have the impression I'm moving too much bytes in memory.
Anyhow, your new speed tests will be added into new release version.
Ciao
Eros
Petr Schreiber
11-01-2008, 14:18
Hi Eros,
here are the results, they somehow confirm Kent ones.
Attached scripts can be run using BAT file, and write TAB deleimited value, timed using QueryPerformanceCounter.
Difference is very little, generally it is a bit worse, but just by few msecs ( best improvement about 4% ).
Noticable improvement was only in Test_Speed_CountOneMillion and Test_Speed2_Function on my PC ( 4% ), rest was much less, or worse than original core :( ( but by 5% max :) ).
Thanks,
Petr
ErosOlmi
11-01-2008, 15:34
Thanks a lot Petr. Always super professional!
Data confirmed Kent tests so, no way. I will reconsider all the changes applied.
Ciao
Eros
Petr Schreiber
11-01-2008, 15:55
Don't worry Eros,
I realise some optimizations do not have so positive impact in my code too.
Nothing better than roll back whole night changes then :D
Here is last set of benchmark scripts, it generates Excel / OpenOffice Calc friendly report from tests ( just 2 TAB separated columns - test name and time elapsed ).
Bye,
Petr
P.S. Abraxas or someone created cool benchmarking script which exchanged cores on the fly, where is that :) ?
Michael Clease
11-01-2008, 22:57
Did I hear my name ;D
http://community.thinbasic.com/index.php?topic=1269.msg8903#msg8903
ErosOlmi
11-01-2008, 23:27
Post closed. Attached file removed.
Thanks a lot to all.