I've noticed a few threads recently regarding speed. I've decided to throw this one at you all. This is a real situation I have (I'm already using one of the scenarios) and would be interested to know the results...
The players...
oParent = Application Object.
oChild = Instantiation (on oParent) of VFP DLL to do calculations.
oForm = A Form (managed by oParent).
Procedure = A Procedure.
OK? Now what I'm achieving...
Controls on oForm need to call methods in oChild. There will be quite a few calls on each form.
The scenarios...
A) oForm.Control calls Procedure which in turn calls oParent.oChild.Method
B) oForm.Control calls oParent.Method which in turn calls oParent.oChild.Method
I cannot call oParent.oChild.Method directly as I need to ensure that oChild exists and don't want to repeat the checks everywhere.
Which one is fastest? Bearing in mind that this will form a central part of the application and EVERY form will have many of these calls. This is not just a single-pass test (I wouldn't put it here if it was).
I'd be very interested to see what replies I get to this...
TIA,