Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OOP : Method Call slower than function call
Message
 
To
21/09/1998 14:23:01
Dave Nantais
Light speed database solutions
Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00139174
Message ID:
00139198
Views:
22
>it was stated that a method call is UP TO 7 times slower than a function call. What conditions make the method call that much slower.

The fact that the function called depends on the object. This means that there must be an extra decision made at runtime as to which function is called with a method. A procedure call always goes to the same place (assuming the same library is set).

>Are there certain guidelines i can follow to minimize the time required for a method call ?

Not that I know of.

>Also if disk access is the slowest part of the process at say 10000 times slower than executing a method call or 70000 times slower than
>making a function call then isn't the difference in speed irrelevant?

It depends on the application. If it reads a tiny table, then does half an hour's worth of computations with the data, then the method calls will predominate.

However, as I said here recently, "Premature optimization is the root of all evil." First make it work. Then (if and only if necessary) make it fast.
Previous
Reply
Map
View

Click here to load this message in the networking platform