Slow performance compared to C++, ideas?

deadalnix deadalnix at gmail.com
Mon Jun 3 18:01:44 PDT 2013


On Monday, 3 June 2013 at 23:47:33 UTC, Jonathan M Davis wrote:
> 1. That'll only affect Windows unless we change the linking 
> model on *nix
> systems.
>

It is evolving on the C/C++ side, so I see no point in being more 
conservative than theses.

> 2. That'll only affect stuff that isn't exported from a shared 
> library. There
> are plenty of cases where a class is exported from a shared 
> library, and it
> has lots of functions on it which are supposed to be 
> non-virtual.
>

Calling into/from a shared lib is doomed to be a performance hit 
as the called code is opaque to the compiler anyway. Which mean 
assuming the worse on the caller side and disabling most 
optimizations.

> 3. Doesn't doing this require that the _linker_ optimize out 
> the virtuality of
> the functions for you? If that's the case, it won't work any 
> time soon (if
> ever), because we use the C linker, not our own.
>

I'm not sure what it imply for GCC, but this is actually not hard 
to implement in LLVM.


More information about the Digitalmars-d mailing list