Inherent code performance advantages of D over C?

ponce contact at gam3sfrommars.fr
Sat Dec 7 01:31:38 PST 2013


On Saturday, 7 December 2013 at 00:40:52 UTC, Manu wrote:
> Assuming a comparison to C++, you know perfectly well that D 
> has a severe
> disadvantage. Unless people micro-manage final (I've never seen 
> anyone do
> this to date), then classes will have significantly inferior 
> performance to
> C++.
> C++ coders don't write virtual on everything. Especially not 
> trivial
> accessors which must be inlined.

I concur with Manu and if D gain more adoption we can only expect 
calls that should not be virtual be virtual. Removing unecessary 
virtual calls in a C++ codebase gives significant performance 
improvements in my experience.

But it's not even so much about virtual calls being slower than 
the myth that every function being redefinable in a sub-class _by 
default_ is somehow a good thing. I don't think it is at all.



More information about the Digitalmars-d mailing list