Slow performance compared to C++, ideas?
deadalnix
deadalnix at gmail.com
Thu Jun 6 00:58:16 PDT 2013
On Thursday, 6 June 2013 at 07:43:30 UTC, Paulo Pinto wrote:
> As I mentioned before, given that I speak more than really
> using D for anything, my opinion should not count.
>
> In C#'s case, which is similar to D, you not only have a VM,
> but also ahead of time compilation.
>
> Virtual by default wins when you have a VM that can do
> devirtualization.
>
devirtualization is a link time problem, not a runtime one. We
can do that in D (except when it come to shared objects) and I
even proposed solutions to do so.
revirtualization, however, can only be done with a JIT compiler.
And it is done in C# . They had this option, D won't have it.
> When doing static compilation, even with LTO, you are limited
> in what you can do, specially if generating dynamic libraries.
>
Exact, but this is nothing specific to virtual. shared library
come at a cost, as the call is opaque to the compiler. It has to
assume the worse and must disable most optimizations anyway. You
are trying to pose a bandage on a wooden leg.
More information about the Digitalmars-d
mailing list