Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do FunctionName.prg
Message
From
13/05/2021 07:41:17
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
13/05/2021 06:38:43
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680170
Message ID:
01680365
Views:
35
>>Why are you arbitrarily storing multiple procedures/functions in a single .prg? This does not help the compiler. If you build separate .prgs per function the exe will run them faster, than if it has to dig into other files first.
>
>another myth,
>
>Consider:
>
>
>SET PROCEDURE TO MyFunction3
>
>nSec = SECONDS()
>FOR nT = 1 TO 1000000
>	x = Myfunction()
>ENDFOR
>? "Myfunction, same proc file", SECONDS() - nSec
>
>nSec = SECONDS()
>FOR nT = 1 TO 1000000
>	x = Myfunction2()
>ENDFOR
>
>? "Myfunction2,  seperate Prg", SECONDS() - nSec
>
>nSec = SECONDS()
>FOR nT = 1 TO 1000000
>	x = Myfunction3()
>ENDFOR
>? "Myfunction3, set procedure", SECONDS() - nSec
>
>WAIT window
>
>FUNCTION MyFunction()
>RETURN .T.
>
>
>Outcome (ran as EXE) :
>Function in the same source file 0.2 seconds for 1 million calls
>Function as PRG exactly the same: 0.2 seconds for 1 million calls
>Function as part of procedure file using SET PROCEDURE: 0.185 for 1 million calls.
>
>There is ABSOLUTELY NOTHING to gain performance wise to split function up into procedures.

Walter, while I not say there is many use of the prg procedure thing, your test setup is not the best. You would need something comparable and to much depends on CPU wonders those days. Your tiny code will simply run inside CPU cache, optimized by CPU whatever. The dust on the CPU cooler might have more influence.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform