Anyone's afraid of BlitzMax speed?

For everything that's not in any way related to PureBasic. General chat etc...
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

You cant exactly put small filesize = slow speed... Bigger filesize probably means more bloat, however as Sebe said, it might be the random command.
Brice Manuel

Post by Brice Manuel »

The base of this was the SIEVE OF ERATOSTHENES benchmark in which BMX was quite fast
You want to really see how slow BMax is change everything to GLOBALS in that sieve test and run the test with globals for each of the languages.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

thefool wrote:You cant exactly put small filesize = slow speed.
No, that's true. But you can sometimes sacrifice one thing to gain another, I was just wondering if that was a potential reason.

Anyhow, nvm, not important.
@}--`--,-- A rose by any other name ..
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

Well, I don't think you'll have to sacrifice small filesize in favour of speed. Look at the BBP benchmark. PB is faster here AND produces a executable that is far beyond everything BMX could dream of. I really believe the random command of PB is slower. Other possibility: typecasting is faster in BMX. I think that's subject to check :wink:
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

ATCFCR benchmark

PureBasic - V4.00beta7 - Size: 10.5KB
Random benchmark : Time: 1547 m/secs
XXX -> String :: Time: 6843 m/secs
XXX -> Double :: Time: 2188 m/secs
XXX -> Quad :: Time: 109 m/secs
XXX -> Float :: Time: 2156 m/secs
XXX -> Long :: Time: 47 m/secs

BlitzMax - V1.12demo - Size: 52.5KB
Random benchmark : Time: 1351 m/secs
XXX -> String :: Time: 4055 m/secs
XXX -> Double :: Time: 848 m/secs
XXX -> Quad :: Time: 96 m/secs
XXX -> Float :: Time: 834 m/secs
XXX -> Long :: Time: 64 m/secs

Boom, that's quite a surprise. So typecasting (and maybe function calls) are faster in BMX. I added the test in the zip file you can find here: http://www.kudoscry.com/public/test.zip
Seems that PB loses :?
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Please use high resolution timers for benchmarks... Even if they have lots of iterations.

Secondly, some operations like SHL and SHR in Intel processors are slower than on AMDs. The same case happens with other instructions believe it or not.



On the other hand, for real benchmarks you should run a test at least 10 times, then take the average of the results ;).

Also don't forget to run them at the same conditions (as much as possible).

Finally: BMX is bloated crap, in my opinion. I really wont believe its any faster. However, again... BMX is just to me, a language parser and some open-sourced libraries (hey, which in that case is good to have the source of a lib, that case you dont depend on the author, although I guess compile times would be a little slower?)... Also, is the demo any different from the retail product?. Benchs should be done with both retail and not with one demo and a retail, etc. IMO.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

ATCFCR benchmark

PureBasic - V4.00beta7 - Size: 10.5KB
Random benchmark : Time: 1422 m/secs
XXX -> String :: Time: 8963 m/secs
XXX -> Double :: Time: 3104 m/secs
XXX -> Quad :: Time: 180 m/secs
XXX -> Float :: Time: 3045 m/secs
XXX -> Long :: Time: 90 m/secs

BlitzMax - V1.18 (retail) - Size: 55.5KB
Random benchmark : Time: 1365 m/secs
XXX -> String :: Time: 5013 m/secs
XXX -> Double :: Time: 1070 m/secs
XXX -> Quad :: Time: 163 m/secs
XXX -> Float :: Time: 1041 m/secs
XXX -> Long :: Time: 69 m/secs

Pentium M 1.70 GHz, 2 GB RAM (heavy loaded, 93 processes)
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I've extracted this from one of the Sebe's comparations:
PB

Code: Select all

Procedure Float2String()
  For Iter = 0 To 999999
      StringArray(Iter) = StrF(FloatArray(Iter), 18)
  Next
EndProcedure
vs BMX

Code: Select all

Function Float2String()
  For Iter = 0 To 999999
    StringArray[Iter] = FloatArray[Iter]
  Next
End Function
@Sebe, where is the 18 decimals limitation in the MBX version ??? :o
does StringArray[Iter] contain a string after that functions is performed in BMX?? :?:
Else, you are lieing to all of us, and we must not listen you anymore :x
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

where is the 18 decimals limitation in the MBX version
Floats/Doubles in strings are handled at 18 decimals in BMX :? I came across this when tested my first benchmark and wondered why the BMX floats have more digits than the PB ones :lol:
does StringArray[Iter] contain a string after that functions is performed in BMX??
It does (or according to the CRAPPY helpfile of BMX it should). [ANY TYPE] -> String is performed automatic by BMX while String -> [ANY TYPE] must be made manual.

I was just wondering about some of the test results and I'll try to find the reasons.
My first approach is called FuCa. It's a simple FunctionCall Benchmark and I've added it here: http://www.kudoscry.com/public/test.zip

First test results:
FuCa Benchmark
PureBasic - V4.00beta7 - Size: 4.5KB
Time for 1000000000 function calls: 9047 m/secs

BlitzMax - V1.12demo - Size: 48.5KB
Time for 1000000000 function calls: 18426 m/secs

So PB is roughly 2 times as fast as BMX speaking of pure (LOL) function calls. Next stop will be arrays. I have a funny feeling that it's the arrays that are faster in BMX :?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Mmmhh... anyway a sincere comparison test should be with real task, like calculations, indexing a database, etc.
But i don't trust in loops which do every loop the samething.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

I'm curious: Would someone please explain what's the use of knowing what
language performs better in what situation? Is the purpose something like
getting a justification for having spent money on a certain product?
Good programmers don't comment their code. It was hard to write, should be hard to read.
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

What question... :P

Btw:

Code: Select all

; ab(5) = 7
  MOV    ebp,dword [a_ab]
  MOV    dword [ebp+20],7
; ab(5) = c
  PUSH   dword [v_c]
  POP    dword [ebp+20]
; ab(d) = 8
  MOV    ebx,dword [v_d]
  SAL    ebx,2
  MOV    dword [ebp+ebx],8
; ab(d) = c
  PUSH   dword [v_c]
  MOV    ebx,dword [v_d]
  SAL    ebx,2
  POP    dword [ebp+ebx]
Actually seems not bad, does it? Perhaps the PUSH and POP could be
eliminated.

A bit harder to do:

Code: Select all

; k = ab(d) * ab(d)
  MOV    ebx,dword [v_d]
  SAL    ebx,2
  MOV    ebx,dword [ebp+ebx]
  MOV    edi,dword [v_d]
  SAL    edi,2
  IMUL   ebx,dword [ebp+edi]
  MOV    dword [v_k],ebx
I'm always for speeding up the executable!
Athlon64 3700+, 1024MB Ram, Radeon X1600
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

I'm curious: Would someone please explain what's the use of knowing what
language performs better in what situation? Is the purpose something like
getting a justification for having spent money on a certain product?
I think its more of a "mine is bigger than yours" sort of thing :wink:
quidquid Latine dictum sit altum videtur
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Of course mines bigger.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

freak wrote:I think its more of a "mine is bigger than yours" sort of thing :wink:
Ok thanks, now I got it! :D
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply