Slow performance compared to C++, ideas?

Jacob Carlborg doob at me.com
Sun Jun 2 02:53:26 PDT 2013


On 2013-06-01 23:08, Jonathan M Davis wrote:

> If you don't need polymorphism, then in general, you shouldn't use a class
> (though sometimes it might make sense simply because it's an easy way to get a
> reference type). Where it becomes more of a problem is when you need a few
> polymorphic functions and a lot of non-polymorphic functions (e.g. when a
> class has a few methods which get overridden and then a lot of properties
> which it makes no sense to override). In that case, you have to use a class,
> and then you have to mark a lot of functions as final. This is what folks like
> Manu and Don really don't like, particularly when they're in environments
> where the extra cost of the virtual function calls actually matters.

If a reference type is needed but not a polymorphic type, then a final 
class can be used.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list