Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
After January 1st
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00308678
Message ID:
00312354
Vues:
64
>>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.

No problem here, Jim; my decision to use the native expression in this context was premised on an assumption that the cost was more on the order of magnitude level, rather than a factor of two. I'd be pleased to death to know that the cost of using the more maintainable and understandable UDF if the impact is really that small.

Christof made a very valid point; "clever", obscure coding doesn't cut it. I can always go back and optimize the code once I'm sure there is a problem, and I've isolated the problem as being at that point in the code.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform