Running speed compare between purebasic and powerbasic

For everything that's not in any way related to PureBasic. General chat etc...
goldmate
User
User
Posts: 12
Joined: Sat Jan 03, 2009 1:28 pm

Running speed compare between purebasic and powerbasic

Post 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)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Running speed compare between purebasic and powerbasic

Post 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),"")
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
goldmate
User
User
Posts: 12
Joined: Sat Jan 03, 2009 1:28 pm

Post by goldmate »

debug mode is disable already
goldmate
User
User
Posts: 12
Joined: Sat Jan 03, 2009 1:28 pm

Post by goldmate »

It is only a sample,not a comprehensive compare.
I like purebasic more than powerbasic.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

well, speed comparsion this way are useless(as freak says).
before any flame occurs, i move and close this topic.
Nothing personal.
SPAMINATOR NR.1
Locked