MAX v Blitz2D: Speed

BlitzMax Forums/BlitzMax Beginners Area/MAX v Blitz2D: Speed

Makepool(Posted 2005) [#1]
Has anybody done a MAX v Blitz 2D speed comparison? I searched for one but couldn't find anything on it.


tonyg(Posted 2005) [#2]
It's a bit tricky without knowing in which context.
This might help...
Performance1
A few people have had performance issues with certain drivers and amount of RAM...
Performance2
Performance3


Neuro(Posted 2005) [#3]
Since BlitzMax allows for flexibility, you have to be real carefull how you're handling the images. The only BMax app/demo that really crapped out my old laptop(ATI 16 mb mobility m4 on my p3 800 mhz, 384mb ram) was this chess game someone was writing a while back. Otherwise, everything I ran, and the current game I'm building - which is image/graphic intensive - runs just fine on my system.


FlameDuck(Posted 2005) [#4]
Has anybody done a MAX v Blitz 2D speed comparison?
Several. Neither are particularly conclusive tho'.

The short version is that BlitzMAX has more optimizations, and a better compiler, so "raw" operation output should be faster, if for no other reason, then because of better register utilization.

Things that rely heavily on stdc functionality could be slower, depening on how you use them.

Also keep in mind that OOP generally adds a slight overhead.

The question you really should be asking yourself however is a different one: Who really cares? Most people favor short development times over raw speed anyway, and in BlitzMAX game development time is rediculously fast. So what if it only runs at 170 fps (as opposed to 200)?


Robert Cummings(Posted 2005) [#5]
So blitzmax is slower?


klepto2(Posted 2005) [#6]
No, If you use the OOP correctly then Blitzmax is faster then Blitz2d. The non OOP Commands are easier to implement but slow Bmax down.
Don't know if this complete correctly. but this is my Experience.


FlameDuck(Posted 2005) [#7]
So blitzmax is slower?
Not universally no. It depends on what you're doing with it. You could write examples that prove both. It's like comparing Apples and Oranges. In general the object overhead is cancled out by compiler optimizations.

I've recently ported my crossblend function to BlitzMAX, and while it's still not very optimized (by a long shot), it's noticably faster than on both Blitz2D and BlitzPlus.


EOF(Posted 2005) [#8]
Some tests you can try for yourself ...


This zip includes source + exe for BlitzMax , Blitz3D, C++, and Pure Basic.

Sieve Speed Tests

Anyone fancy doing other versions such as C++ (source+exe) ?

Here's the Max code



xlsior(Posted 2005) [#9]
I'm finding (after several runs of each) that the Max version is 1.7 times faster than the Pure Basic version and over 20 times faster than the Blitz3D version. Woosh!


That Max version runs 25 times faster than the B3D on my computer... 2.5 times as fast as PureBasic.


DocFritz(Posted 2005) [#10]
Um... doesn't that have something to do with the fact, that the MaxDemo performs 5000 iterations while the b3dDemo has to do 50000 Iterations?


Robert Cummings(Posted 2005) [#11]
I think in my own tests it was nearly twice as fast as Blitz3D and 0.8 times as fast as C++.


Barnabius(Posted 2005) [#12]
Max version is about twice as fast as B3D version. As DocFritz pointed out, one has to change the number of iterations to 5000 in B3D to make this a proper comparison.

Barney


EOF(Posted 2005) [#13]
Oops. Updated zip (all versions running 50000 iterations).

Now shows Max version to be:

1.79 times quicker than Blit3D version
1.72 times quicker than Pure Basic version


xlsior(Posted 2005) [#14]
Heh, didn't catch that either.

Now shows (50,000 iterations)

BlitzMax: 4460
Blitz3D: 12006
PureBasic: 11112

...making Blitzmax sample 2.69 times as fast as B3D and 2.49 times as fast as PureBasic on my computer.

JB: Are you running Intel or AMD? That could account for some of the speed differences between our results as well, since some of executables may be more optimized towards one platform than the other.


EOF(Posted 2005) [#15]
Intel P4 3.6Ghz (with Hyper Threading).


FlameDuck(Posted 2005) [#16]
Here is some reference code in C++:

And a zip with a binary for those without MinGW. The results for the TabletPC are rather interesting:

C++ Reference: 9.6 secs
BlitzMAX: 11.2 secs
Blitz3D: 17.7 secs
PureBasic: 18.9 secs

So Blitz3D and PureBasic are nearly equally fast, BlitzMAX is nearly twice as fast, and C++ is marginally faster than that.


EOF(Posted 2005) [#17]
Added to my zip.
Very interesting. Max is certainly hot on the heels of C++.

Any other versions?


Neuro(Posted 2005) [#18]
Heh...just for sh*ts and giggles, lets have someone who will admit they have Dark Basic Pro give it a whirl and see what times they get...


stevious(Posted 2005) [#19]
I ported the code to VB.NET. My times are as follows:

C++ reference: 3.437 secs
BlitzMAX: 4.008 secs
Blitz3D: 10.524 secs
PureBasic: 10.531 secs
VB.NET: 7.853 secs

Tests were performed on an Athlon 64 3500+