Old problem with performance

Denis Koroskin 2korden at gmail.com
Sun Feb 8 07:20:47 PST 2009


On Sun, 08 Feb 2009 18:09:41 +0300, naryl <cy at ngs.ru> wrote:

> It's a bit offtopic but I'd be grateful if someone can explain why D  
> with structs completes this simple benchmark (see attachment) so slowly  
> compared to C++ with classes on stack:
>
> D struct - 27.85s
> C++ stack - 8.32s
>
> D class - 271.58s
> C++ heap - 249.32s
>
> Compiled with "dmd -O". -release decreases performance by 10% in this  
> case. -inline doesn't affects it at all.

Well, you don't compare C++ vs D struct speed but rather C++ vs D IO.
I believe writefln is a bottleneck.




More information about the Digitalmars-d mailing list