benchmark on binary trees

Alex via Digitalmars-d-learn digitalmars-d-learn at
Sun Dec 6 00:35:33 PST 2015

Ok, lets conclude this post for now. Did some comparison runs 
with the original C++ code. Missed this at the beginning.
The results so far are as following:

Here is the original code in C++.

With modifications to be able to run it on my mac os machine this 
results in the code available here:
compilation done with
g++ -c -pipe -O3 -fomit-frame-pointer -march=native -fopenmp 
main.cpp -o main.o && g++ main.o -o -fopenmp 

Here you can find the last version of my D code:
compilation done with
dmd -release -O -boundscheck=off -inline main.d

time comparison, just with
time ./main

for C++
real 0m8.255s
user 0m7.342s
sys 0m0.905s

for D
real 0m35.356s
user 0m35.149s
sys 0m0.154s

so the overall factor is round about 5.

Thanks for commenting to everyone! If anybody has further ideas - 
all of them would be appreciated :)
The original site is not interested in any further languages to 
be tested, so my experiment ends here for now...

More information about the Digitalmars-d-learn mailing list