benchmark on binary trees

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 7 02:42:23 PST 2015


On Sunday, 6 December 2015 at 08:45:10 UTC, Rikki Cattermole 
wrote:
> Why is TreeNode not final?
This is an interesting hint! Just after adding final the program 
takes two seconds less... This is roughly 5%. Do you have another 
hints of this kind? ;)

> Also yours does not use threads in any way.
>
> If you cannot add multithreading on D, remove it from c++ 
> before comparing. They are not equal.
Yes... I'm aware of this discrepancy, and I tried how the time 
statistics differ with and without the #pragma statement. With 
the statement it is half a second slower then without. This seems 
strange to me, and I don't have a clue why it is so.
But as this doesn't change very much for the D/C++ comparison and 
I think the correct goal is to have a parallel version in D I let 
the #pragma statement inside.


More information about the Digitalmars-d-learn mailing list