Page 1 of 1

Fred is a here it seems that he pushed Pbs Performance even

Posted: Sat Feb 04, 2006 12:22 am
by Nik

Code: Select all

Structure SmallStruct
A.b
B.b
C.l
D.l
E.l
EndStructure

Procedure Funktion( *Value.SmallStruct )
Protected Temp.l
Temp.l+*Value\A
Temp.l+*Value\B
Temp.l+*Value\C
Temp.l+*Value\D
*Value\E=Temp.l
EndProcedure

Procedure MyProcedure2(Value1.l,Value2.b,Value3.w)
Static TehStruct.SmallStruct

For i=0 To Value1
 TehStruct\C=TehStruct\B-i
 TehStruct\D=TehStruct\C+i
 Funktion(@TehStruct)
Next
ProcedureReturn Value3=Value2
EndProcedure
Time.l=ElapsedMilliseconds()
For a=0 To 1000
MyProcedure2(a,a%255,a)
Next
Time=ElapsedMilliseconds()-Time
MessageRequester("Zeit:",Str(Time))
Works without any change in both PB Versions but in 4.0 it is twice a fast.
Good Job Fred (I know that it isn't Teh^^)

(It can be that the results vary very much, but in General Pb 4.0 seems to be faster, it also even smaller^^)

Posted: Sat Feb 04, 2006 12:59 am
by freak
Yes, the code generated for Procedures has been optimized a lot, so small
procedures gain a lot in performance.

Posted: Sat Feb 04, 2006 11:40 am
by Num3
Also Sprite 2d and 3d have made a huge performance leap! ;)

Posted: Sat Feb 04, 2006 11:46 am
by Dare2
Dang, I missed this topic the first time and just made a now-redundant topic in General.

But who cares. It is =faster and it is better. It is awesome!

Posted: Mon Feb 06, 2006 12:48 am
by Sebe
Hail to PureBasic! I knew I was right when I dismissed BlitzMax for good in favour of PureBasic 8)