Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
After January 1st
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00308678
Message ID:
00312342
Views:
61
>Christof, here, I argue against the overhead of invoking a UDF from within the context of a single atomic VFP command, not the 'work' of creating the UDF itself. I do not disagree that maintainability and readability suffer using the 'clever' one-liner, however, a call to a UDF is expensive relative to the use of a native expression in a clause, and may make the use of the native expression desirable, even if it's a bit unreadable. If the scope of the one-line statement were small, representing a small number of iterations, the UDF is clearly preferable.


Ok, and here comes Jim with a can of gasoline for the fire. I too prefer the do case construct, but I did test and for 100,000 interations the average time for the do case was .6XX seconds while teh averawge time for the one liner was .39X seconds. Almost twice as fast.

However, I am a firm believer in NOT optimizing for performance until there is a perceived preformance problem and I don't think the difference btween these two approaches will cause a perceived performance problem, hell if we were calulating the issue for 1,000,000 years it would sitll only have a difference of ~3 seconds.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform