wow... fast....

BlitzMax Forums/BlitzMax Beginners Area/wow... fast....

Not that this has anything to do with this forum but man, is this stuff fast!

I am in the middle of porting my scripting engine from Blitz3d over to Blitzmax and I must say, I tested some very complex operations and was able to perform 10,000 of those complex operations in less then 2ms. Mind you thats keeping all functionality inside of the objects and their methods. Each operation I update a few linked lists, change around some variables and assign pointers.

Man, that is fast stuff.

Say, you're right. I've been so busy playing with the new stuff I didn't do any benchmarking.

Back in 2001 when I was deciding whether to go with Blitz or DarkBasic, I tried a little int/float math test with the demo of each (since I planned to use lots more math than graphics). I remember that Dark was slow (though whether slower or faster than Visual Basic I don't recall); Blitz was much faster than both, half the speed of the same demo in C.

I just ran that test again, and BMax only takes 21 ms while B3D takes 42, so Max math now looks to be as fast as C itself. Ver' nice.

hehe strange ... if this math thing has to do with the fact that they both use the same compiler? (GCC) ;)

you don't need GCC to compile with max, only to rebuild modules that contain C source.

I ran a sieve speed test in PureBasic and BlitzMax. Although PureBasic is renowned for its tight code and speed Max came out on top being roughly 2.5 times quicker.

BlitzMax source
' BlitzMax sieve test

Framework brl.blitz
Import brl.standardio
Import brl.system

Const ITERATIONS=10000

Print("SIEVE OF ERATOSTHENES - "+ITERATIONS+" iterations")
Print ""

Global t=MilliSecs()

For Local Iter = 1 To ITERATIONS

	Local flags[8191],i,k,prime
	Local Count = 0

	For i = 0 To 8190
    	flags[i] = 1
	Next

	For i = 0 To 8190
		If flags[i]=1
			prime=i+i
			prime=prime+3
			k=i+prime
			While k <= 8190
				flags[k] = 0
				k=k+prime
			Wend
			count=count+1
		EndIf
	Next

	FlushMem

Next

t=MilliSecs()-t
Print ITERATIONS+" iterations took "+t+" m/secs."
Print ""
Print "Primes: "+Count

End


PureBasic source
; Ported from another Basic For benchmarking purposes...
; PureBasic version

OpenConsole()

#ITERATIONS=10000

Dim Flags(8191)
Print("SIEVE OF ERATOSTHENES - "+Str(#ITERATIONS)+" iterations")
ConsoleLocate(0,2)

t=GetTickCount_()

For Iter = 1 To #ITERATIONS

  Count = 0

  For I = 0 To 8190
    Flags(I) = 1
  Next

  For I = 0 To 8190
    If Flags(I)=1
       Prime = I + I
       Prime = Prime + 3
       K = I + Prime
       While K <= 8190
         Flags(K) = 0
         K = K + Prime
       Wend
       Count = Count + 1
    EndIf
  Next

Next

t=GetTickCount_()-t
Print(Str(#ITERATIONS)+" iterations took "+Str(t)+" m/secs.")
ConsoleLocate(0,3)
Print("Primes: "+Str(Count))

Delay(3000)
End
; ExecutableFormat=Windows
; CursorPosition=5
; FirstLine=1
; DisableDebugger
; EOF


jepp ... and with what was the math module built? :P

jepp ... and with what was the math module built? :P

The same thing the math module in B3D was built with.

Jepp but there it was created as library and called not straight object linked ...