C++ vs. D memory management performance (Was: Faster Virtual Method Dispatch)

Sean Kelly sean at f4.ca
Thu Apr 27 14:01:56 PDT 2006


Quick follow-up.  I decided to re-run the tests using the full text of 
the King James Bible (http://www.gutenberg.org/dirs/etext90/kjv10.txt) 
in an attempt to get better timing resolution, as it's 4,342 KB vs. 
Alice in Wonderland's 160 KB.  Here are my results:


D version (wc):

Execution time: 1.409 s
Execution time: 1.473 s
Execution time: 1.295 s

C++ version 1 (wccpp2):

Execution time: 1.779 s
Execution time: 1.762 s
Execution time: 1.792 s

C++ version 2 (wccpp3):

Execution time: 1.758 s
Execution time: 1.309 s
Execution time: 1.297 s

C++ version 3 (wccpp4):

Execution time: 0.693 s
Execution time: 0.767 s
Execution time: 0.704 s


Surprisingly, the slice code does substantially better than both the 
other C++ versions and the D code.  Perhaps this evening I'll re-run the 
C++ tests under Visual Studio to give the hash table a test drive.


Sean



More information about the Digitalmars-d mailing list