Page 1 of 1

Running speed compare between purebasic and powerbasic

Posted: Sat Feb 07, 2009 3:24 am
by goldmate
purebasic code[4.30]:
timer.f=ElapsedMilliseconds()
k.l
For i.l=1 To 100000
For j.l=1 To 100000
k=i+j
Next j
Next i
MessageRequester(StrF(ElapsedMilliseconds()-timer),"")
End

purebasic cost 30.9 seconds
powerbasic cost 11.3 seconds with likely code

My computer:Intel duo core E4500
System:Microsoft XP(SP2)

Re: Running speed compare between purebasic and powerbasic

Posted: Sat Feb 07, 2009 4:38 am
by PB
You did remember to use "DisableDebugger" at the head of your PureBasic
source, right? Because that's how executables are built with PureBasic.
And you do know that ElapsedMilliseconds() doesn't return a float?
So, please post your results with this corrected PureBasic code:

Code: Select all

DisableDebugger
timer.l=ElapsedMilliseconds()
k.l
For i.l=1 To 100000
For j.l=1 To 100000
k=i+j
Next j
Next i
MessageRequester(Str(ElapsedMilliseconds()-timer),"")

Posted: Sat Feb 07, 2009 5:38 am
by freak
> You did remember to use "DisableDebugger" at the head of your PureBasic source, right?

That'll only get you half way there. You have to turn it off entirely: http://www.purebasic.fr/english/viewtop ... 209#242209

Oh, and this test is nonsense anyway. If you want to do a real comparison then test with a code/algorithm that actually solves a real world problem. Measuring how fast a useless empty loop will run tells you nothing.

Posted: Sat Feb 07, 2009 5:46 am
by goldmate
debug mode is disable already

Posted: Sat Feb 07, 2009 8:43 am
by goldmate
It is only a sample,not a comprehensive compare.
I like purebasic more than powerbasic.

Posted: Sat Feb 07, 2009 8:59 am
by Rings
well, speed comparsion this way are useless(as freak says).
before any flame occurs, i move and close this topic.
Nothing personal.