Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do FunctionName.prg
Message
From
13/05/2021 06:38:43
Walter Meester
HoogkarspelNetherlands
 
 
To
12/05/2021 17:23:20
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680170
Message ID:
01680353
Views:
44
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform