Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Optimizatio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 7 Topic 2408 of 2421
Post > Topic >>

Re: Optimization for OOP

by "Dmitry A. Kazakov" <mailbox@[EMAIL PROTECTED] > May 5, 2008 at 06:37 PM

On Mon, 05 May 2008 09:45:24 +0200, Torben Fgidius Mogensen wrote:

> The most important optimisation is to get rid of dynamic method calls.
>
> This can, however, be quite tricky as you can't tell if a method can
> be overridden without knowing the whole program, so it plays havoc
> with separate compilation.  A compromise is to allow methods to be
> declared "final", which ensures it is never overridden.

I think a consistent types system would be a better way. In Ada it is
always known if a call is dispatching or not. That is because of
proper typing. When an object is of a specific type, its methods never
dispatch, for that obvious reason, that the type is known to be
specific.

For the same reason in Ada there is no implicit re-dispatch from the
method bodies. A method always deals with a specific type, it has
dispatched before. Therefore any further calls from there to other
methods never dispatch again. The compiler knows their targets
statically, it can inline them etc.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de




 7 Posts in Topic:
Optimization for OOP
sgkelly4@[EMAIL PROTECTED  2008-05-03 17:53:05 
Re: Optimization for OOP
torbenm@[EMAIL PROTECTED]  2008-05-05 09:45:24 
Re: Optimization for OOP
"Dmitry A. Kazakov&q  2008-05-05 18:37:26 
Re: Optimization for OOP
"lucretia9@[EMAIL PR  2008-05-05 18:51:58 
Re: Optimization for OOP
"Dmitry A. Kazakov&q  2008-05-06 09:35:25 
Re: Optimization for OOP
sgkelly4@[EMAIL PROTECTED  2008-05-06 23:13:32 
Re: Optimization for OOP
Tony Finch <dot@[EMAIL  2008-05-05 18:11:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 0:55:07 CDT 2008.