PDA

View Full Version : Little present before leaving: optimized thinCore.dll



ErosOlmi
13-08-2007, 19:18
Hi everybody.

Before leaving for 4 days I wanted to post here a little present. An optimized version of thinBasic Core engine: thinCore.dll
Please find here attached a zip file with thinCore.dll. Download and copy it over the one in \thinBasic\ directory.

I have mainly optimized the way +=, -=, *=, /=, \= numeric expression assignment are handled, both simple variable or UDT elements.

On my tests I've got some nice results: one million loop speed test went from 0.30 to 0.23 secs on my box. Also some TBGL scripts where those assignment are used seem having noticeable effects. Petr seems confirming similar results so hope you will benefit of this change too (sometimes it depends on CPU model). Even if difference seems not so much, consider that a little above normal complexity TBGL script can have those assignment called thousands times per seconds, so a little improve can get some interesting FPS more. And this is a great advantage for TBGL (or other) script execution and playability.

Feature will be present in next release (around September) but I wanted to give a preview.

Ciao and see you soon
Eros

PS: be sure to have current latest thinBasic preview version 1.4.0.1 installed before using attached thinCore.dll

ADDED 2007.08.20: thinCore.ZIP updated with some more speed enanchement this time on UDT elements reading. Update thinCore.dll in your \thinBasic\ directory with the attached one. But before doing that, use script \thinBasic\SampleScripts\General\Speed\Test_Speed2_Typed.tBasic and take note of the time. Than update thinCore.dll and check again time.

ADDED 2007.08.21: thinCore.ZIP removed. Functionalities now present in thinBasic preview version 1.4.0.1

Petr Schreiber
13-08-2007, 19:57
:)

Very nice present!
Even on my PC the improvement is generally about 20%, which is really not bad :)

Strongly recommended...


Bye,
Petr

Michael Hartlef
13-08-2007, 21:33
Thanks Eros, and have a good time!

kryton9
14-08-2007, 00:37
Thanks Eros, have a great trip, hope you have nice weather and can find relaxation threshold quickly!

ErosOlmi
20-08-2007, 10:30
Hi all.

I've updated thinCore.ZIP attached to the first post of this thread. There should be some more speed enhancements this time on UDT elements reading.

Update thinCore.dll in your \thinBasic\ directory with the attached one. But before doing that, use script \thinBasic\SampleScripts\General\Speed\Test_Speed2_Typed.tBasic and take note of the time it takes to run. Than update thinCore.dll and check again time.

I need some confirmations. Not sure if all can get improved results. Some improvements can vary depending on processor type.

Thanks a lot for your time.
Eros

Michael Hartlef
20-08-2007, 11:31
I'll test it tonight when I'm back from work and house is quite. My son is sick since thursday night, so I'm not sure if I can make it.

Anyway, have a good time. :)

ErosOlmi
20-08-2007, 11:39
Thank you Mike, no problem.

Just wanted to say I'm also working on nested UDT ;)
Parsing of TYPE/END TYPE with nested UDT seems working so far. Now I need to parse nested UDT when used in assignments and expressions.

Ciao
Eros

Michael Hartlef
20-08-2007, 13:04
Damn, then I have no excuse for not working on thinPOSE anymore. ;D

kryton9
21-08-2007, 00:02
Thanks Eros. Nested UDT's will bring lots of power to us and open many doors, thanks a lot!!

Here are my speed test results:

Before and After
250 219 that is some improvement, wow!

ErosOlmi
21-08-2007, 00:25
Thanks a lot Ken.

This is just a little test example. It seems not much, but if you consider the many times an UDT element is accessed during a script like TopDown3D or other possible TBGL games. it will bring some interesting FPS (Frames Per Seconds) more to the game when using UDTs.

Ciao
Eros

kryton9
21-08-2007, 01:09
That is a little over 12% improvement that is really good if you ask me. That is a pretty substantial speed improvement and like you said on repetitive tasks that will make a quite a difference, so thanks looks like a nice tweak!!

Michael Hartlef
21-08-2007, 06:21
Here are my results

Petr Schreiber
21-08-2007, 09:03
Hi,

on my PC the result times are a bit jumping, maybe it is just GetTickCount behaviour :)

Anyway, I attached most common results on very very complicated chart.
I can see I have the same results as Mike :)


Thanks,
Petr

ErosOlmi
21-08-2007, 12:44
Thanks to all.
All those improvements are now in current thinBasic preview version 1.4.0.1

Post closed.