Page 3 of 5

Posted: Tue Mar 21, 2006 9:22 am
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.

Posted: Tue Mar 21, 2006 10:58 am
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.

Posted: Tue Mar 21, 2006 1:17 pm
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.

Posted: Tue Mar 21, 2006 3:42 pm
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:

Posted: Tue Mar 21, 2006 5:15 pm
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 :?

Posted: Tue Mar 21, 2006 7:50 pm
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.

Posted: Tue Mar 21, 2006 7:53 pm
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)

Posted: Tue Mar 21, 2006 8:12 pm
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

Posted: Tue Mar 21, 2006 8:49 pm
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 :?

Posted: Tue Mar 21, 2006 9:00 pm
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.

Posted: Tue Mar 21, 2006 9:00 pm
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?

Posted: Tue Mar 21, 2006 9:10 pm
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!

Posted: Tue Mar 21, 2006 9:10 pm
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:

Posted: Tue Mar 21, 2006 9:12 pm
by dagcrack
Of course mines bigger.

Posted: Tue Mar 21, 2006 9:22 pm
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