Performance

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Fri May 30 08:23:05 PDT 2014


On Fri, 2014-05-30 at 13:35 +0000, Thomas via Digitalmars-d wrote:
> I made the following performance test, which adds 10^9 Double’s 
> on Linux with the latest dmd compiler in the Eclipse IDE and with 
> the Gdc-Compiler also on Linux. Then the same test was done with 
> C++ on Linux and with Scala in the Java ecosystem on Linux. All 
> the testing was done on the same PC.
> The results for one addition are:
> 
> D-DMD: 3.1 nanoseconds
> D-GDC: 3.8 nanoseconds
> C++: 1.0 nanoseconds
> Scala: 1.0 nanoseconds

A priori I would believe there a problem with these numbers: my
experience of CPU-bound D code is that it is generally as fast as C++.

[…]
> Compiler settings for D:
> 
> dmd -c 
> -of.dub/build/application-release-nobounds-linux.posix-x86-dmd-DF74188E055ED2E8ADD9C152107A632F/first.o 
> -release -inline -noboundscheck -O -w -version=Have_first 
> -Isource source/perf/testperf.d
> 
> gdc ./source/perf/testperf.d -frelease -o testperf
> 
> So what is the problem ? Are the compiler switches wrong ? Or is 
> D on the used compilers so slow ? Can you help me.

What is the C++ code you compare against?

What is the Scala code you compare against? Did you try Java and static
Groovy as well?

What command lines did you use for the generation of all the binaries.

Without the data to compare it is hard to compare and help.

One obvious thing though the gdc command line has no optimization turned
on you probably want the -O3 or at least -O2 there.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list