Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does VFP load class methods into memory?
Message
 
 
To
16/11/2009 02:48:53
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01434853
Message ID:
01434915
Views:
73
>>Hi,
>>
>>I am thinking if it is better to break a class into two classes and have one inherit from another. Mainly I am considering this to see if I can speed up loading the objects using the class. I have not quantified the speed of loading the objects, this is just a guess that the speed can be improved. Some forms can have up to about 20 objects using this class (as base or are instantiated in the INIT method).
>>
>>The class has 16 methods. Only 8 of them are used in one part of the program. All 16 are used only in some other parts of the application. My question is, does VFP 9, when instantiating the class, loads the code from all 16 methods into memory? Or it only loads the method when the method is used?
>>
>>TIA.
>
>I wonder whether the number of methods (8 or 16 here) is going to influence the speed of instantiating the objects. The code is the same for any one class. So, I'd say that the methods are loaded only once and shared amongst the objects of the same class. The 'load more code' penalty, if any, only happens once imo

Hi Gregory,

I am not sure I understand/agree with you. Say, the class we are discussing has a method "MyMethod1". If a form uses 20 objects based on this class, the method "MyMethod1" is loaded 20 times, not one time, when the form is instantiated. Right?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform