Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FUNCTION Command and Performance
Message
From
30/05/1999 12:04:31
 
 
To
29/05/1999 20:15:39
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00224372
Message ID:
00224515
Views:
21
>Jonathan,
>
>Hacker's Guide (Faster than a speeding bullet section) says that FUNCTION and PROCEDURE slow things down by as much as factor of 10. They also tested DO MyFunction IN MyProcedureFile and it's also slow.
>

My experience is that the difference in time is closer to 100 to 1. (See thread "90 milliseconds to call simple function" starting on 8May1999.

This is a copy of a post on some of my research:


Yep, if I comment out the FUNCTION line (and the ENDFUNC line), the average time to call goes from 96 milliseconds to 1 ms.

But, and I think this is significant, if I copy the function with the FUNCTION line into the default directory, the average time to call is also 1 ms.

News flash: if I place a CLEAR PROGRAM statement after the function call, the average time goes from 1 ms to 96 ms!

Here is what I am seeing:

Function contains FUNCTION ----------> T--F--T--F--T--F--T--F
Function is in remote directory------------> T--T--F--F--T--T--F--F
Call followed by CLEAR PROGRAM---.> T--T--T--T--F--F--F--F

Lowest average time to call-------------->102.90.68.68.96..01.01.01
Highest average time to call-------------->104.96.72.72.95..03.03.03

So the FUNCTION statement must be intefering with the buffering of the function. I don't know why having the function in the local directory makes a difference to the buffering but that is the only explanation that I can see.

Peter
Peter Robinson ** Rodes Design ** Virginia
Previous
Reply
Map
View

Click here to load this message in the networking platform