Old problem with performance

naryl cy at ngs.ru
Sun Feb 8 07:09:41 PST 2009


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fib.cc
Type: application/octet-stream
Size: 450 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090208/572b34aa/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fib.d
Type: application/octet-stream
Size: 330 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090208/572b34aa/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fibs.cc
Type: application/octet-stream
Size: 357 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090208/572b34aa/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fibs.d
Type: application/octet-stream
Size: 292 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090208/572b34aa/attachment-0003.obj>


More information about the Digitalmars-d mailing list