Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / Play Basic - Crunching the Numbers - Bye Bye DB - Hello Dbpro :)

Author
Message
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Jul 2006 04:58 Edited at: 25th Mar 2011 07:01
PlayBASIC - Crunching the Numbers - Bye Bye DB - Hello Dbpro

I've mentioned before that I use a collection of standard (mostly useless) bits of code for bench marking ! The code is timing the performance in certain areas (loops/basic math/compares & basic trig mainly). With each update (concerning speed) I stockpile compiled PlayBASIC.exe to track PlayBasic's performance over time.

As a bench mark I've been using DB + Dbpro as guide lines, well performance targets . While PB has been able and match and generally beat DB classic code executions performance (it kills it's raw 2D graphics performance btw !) when using 'customized' PB code (built in functions). i've tried to keep the tests as generic as possible.

Previously, you had to run an compiled exe to get the better of DBclassic. Since the exe runtime has no safe code. Now interestingly PB is now matching DB classic from the ide, with full safe code integration! Meaning that once you produce an exe, it leaves DBclassic in the dust. Approaching.. DBpro now.

For the comparison, all examples run in 640*480*16 (full screen exclusive) with no limits upon the sync rate. Test Machine Duron 800mhz with GF2 mx 400

Quote: " Dark Basic Pro V1.5
For Next: Addition: (0.25) Milliseconds
For Next: Add/Sub/Mult/Div: (1.27) Milliseconds
For Next: IF/Then True & False: (0.42) Milliseconds
Basic Trig: (12.70) Milliseconds
Total Time In Seconds: (3.269)
"



Quote: " PlayBasic V1.46
For Next: Addition: (1.8) Milliseconds
For Next: Add/Sub/Mult/Div: (10.22) Milliseconds
For Next: IF/Then True & False: (5.67) Milliseconds
Basic Trig: (12.46) Milliseconds
Total Time In Seconds: (7.042)
"



Quote: " Dark Basic V1.08 (registered)
For Next: Addition: (3.55) Milliseconds
For Next: Add/Sub/Mult/Div: (7.60) Milliseconds
For Next: IF/Then True & False: (7.09) Milliseconds
Basic Trig: (19.27) Milliseconds
Total Time In Seconds: (9.111)
"



While it's no surprise DBpro is in front (it's machine code), but given this generic test it's not that much quicker. So if we can improve the basic math performance in VM2 (which we can indeed ) PB will be very comparable to Dbpro in terms of 'calculation' performance.. Which means that our a JIT solution or machine code translators will be able to match and probably exceed Dbpro's raw performance.

This is the test code btw



VR2
19
Years of Service
User Offline
Joined: 14th Mar 2005
Location:
Posted: 26th Jul 2006 13:47
Quote: "For the comparison, all examples run in 640*480*16 (full screen exclusive) with no limits upon the sync rate"


Doesn't full screen exclusive effectively limit the sync rate to that of the current display (eg 640 X 480 X 16 @75FPS by definition runs at 75 FPS etc...).

Anyway, other than that, congrats on your optimisations
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Jul 2006 18:15
It doesn't matter for DBPro. When you are within a for-loop, there is NO syncing of the display unless you specifically code it.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Jul 2006 19:07
isnt DB interpretted?
if so how is the test valid?

Science, Mathematics, and Physics do not lie - only people do.
tomazmb
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Slovenia
Posted: 26th Jul 2006 19:43
Hello,

Because Playbasic isn't the machine code all-the-way (like DBPro). Kevin will explain this better that I am.

Have a nice day,

Tomaz

Why some people take programming so seriously ?
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 26th Jul 2006 20:14
DBC is interpreted, but the interesting thing is that DBC runs faster when run through the editor than as a standalone exe.

Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jul 2006 03:27 Edited at: 25th Mar 2011 07:02
I've actually taken the most flattering results form all three. On my test machine (Duron 800mhz/gf2) Dbpro performs far better in full screen exclusive than windowed (about +1 seconds for windowed), the DB test is running from the IDE, since stand alone exe's perform worse (about +1 to 1.5). PlayBASIC is running from a standard release exe. From the IDE it's about 2->3 seconds slower. Due to safe code overhead.

PlayBASIC uses a Virtual Machine. Release V1.46 and bellow use VM1. The second generation VM has been in production on and off for over 18 months. Recently we've been stepping towards this change over. Which has only now become the main focus. Generally speaking the original number crunching tests showed VM2 to be *3/*4 faster than VM1. Although today it's probably more around *2 in most cases since VM1 is faster than it used to be. In some areas there may no to be any notable improvement.

While VM2 could in theory close the gap on DBpro by possibly 1 to 2 seconds in such a test, that's not really what were aiming at in this generation. VM2 is really about increasing PB's flexibility, but some extra speed is a very nice by product.

This flexibility will allow us not only implement a JIT (Byte Code to machine code) if we choose, possible mutli platform, or VM2 could actually be used as scripting engine in DBPRO for example.

But that's the future. We'll see were demand takes us.

Login to post a reply

Server time is: 2024-11-24 09:37:23
Your offset time is: 2024-11-24 09:37:23