Slow performance compared to C++, ideas?
deadalnix
deadalnix at gmail.com
Sun Jun 2 00:52:25 PDT 2013
On Saturday, 1 June 2013 at 21:14:43 UTC, Marco Leise wrote:
> Does it really change anything? Today people forget the
> final keyword and tomorrow they forget the virtual
> keyword? :D
>
> What you prefer here depends on what languages you are used to
> do (e.g. C++, Java), how much you use OOP for anything, your
> use of unittesting and mock objects, your need for speed etc.
>
I actually use that quite a lot. Additionally compiler technology
exists now to finalize methods that aren't overriden. It is also
possible to generate code that replace the virtual dispatch by an
simple if if only 2 overrides exists, or even provide a fast path
for the most common override, only conditionally doing the
virtual dispatch.
In other terms, as long as the compiler know about all the
overrides, it can do better than the programmer manually
annotating final/virtual.
More information about the Digitalmars-d
mailing list