Just read the latest newsletter regarding #Optimize vs #Speed. I took a 400k program I am currently working on and decided to try them out (having used neither previously). There was virtually no size difference/change between using either or none at all.
No complaints, just curiosity.
Here's a little sample code:
'
My Results:
Speed = 1.612 secs for each or none (identical for each condition)
Size = 655 bytes for no Directive
Size = 654 bytes when using either Directive (1 byte smaller)
===========================
He of whom many are afraid
ought to fear many.
Sir Francis Bacon
===========================
Later: just for fun I put an #ALIGN 16 in front of the For Ctr loop and the time elapsed plummeted from 1.612 secs to 1.595 secs and Size ballooned from 654 to 741 bytes (for nothing and for Speed). Note #Optimize Size speed stayed at 1.612 though size didn't change. {grin}
Gee, so many options. What's a guy to do? {sigh}
=====================================
"I choose a block of marble
and chop off whatever I don't need."
Francois-Auguste Rodin (1840-1917),
when asked how he managed
to make his remarkable statues
=====================================
No complaints, just curiosity.
Here's a little sample code:
'
Code:
'PBWIN 9.01 - WinApi 05/2008 - XP Pro SP3 #Compile Exe #Dim All '>>>>>>> Virtually no difference in using the #Directives or not '>>>>>>> Rem/Unrem to run test '$Title = "No Directive" '#Optimize SPEED '$Title = "Speed Directive" #Optimize Size $Title = "Size Directive" #Include "WIN32API.INC" #Include "COMDLG32.INC" #Include "InitCtrl.inc" Sub Testing_directives Local ctr As Long Local l As String For ctr = 1 To 100000 l$ = String$(ctr, "k") Next ctr End Sub Function PBMain ErrClear Local tmr As Double tmr = Timer Call Testing_directives ?Using$("Done in #.### secs", Timer - tmr),,$Title End Function '
Speed = 1.612 secs for each or none (identical for each condition)
Size = 655 bytes for no Directive
Size = 654 bytes when using either Directive (1 byte smaller)
===========================
He of whom many are afraid
ought to fear many.
Sir Francis Bacon
===========================
Later: just for fun I put an #ALIGN 16 in front of the For Ctr loop and the time elapsed plummeted from 1.612 secs to 1.595 secs and Size ballooned from 654 to 741 bytes (for nothing and for Speed). Note #Optimize Size speed stayed at 1.612 though size didn't change. {grin}
Gee, so many options. What's a guy to do? {sigh}
=====================================
"I choose a block of marble
and chop off whatever I don't need."
Francois-Auguste Rodin (1840-1917),
when asked how he managed
to make his remarkable statues
=====================================
Comment