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.

Attachment: fib.cc
Description: Binary data

Attachment: fib.d
Description: Binary data

Attachment: fibs.cc
Description: Binary data

Attachment: fibs.d
Description: Binary data

Reply via email to