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

For everything that's not in any way related to PureBasic. General chat etc...
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

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

Post 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^^)
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Yes, the code generated for Procedures has been optimized a lot, so small
procedures gain a lot in performance.
quidquid Latine dictum sit altum videtur
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Also Sprite 2d and 3d have made a huge performance leap! ;)
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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!
@}--`--,-- 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 »

Hail to PureBasic! I knew I was right when I dismissed BlitzMax for good in favour of PureBasic 8)
Post Reply