Is D the Answer to the One vs. Two Language High ,Performance Computing Dilemma?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Aug 18 20:28:26 PDT 2013


On Sun, Aug 18, 2013 at 09:26:45AM +0100, Russel Winder wrote:
> On Sun, 2013-08-18 at 01:59 -0400, John Joyus wrote:
> > On 08/11/2013 04:22 AM, Walter Bright wrote:
> > > http://elrond.informatik.tu-freiberg.de/papers/WorldComp2012/PDP3426.pdf
> > 
> > This article claims the "Performance [of D] is equivalent to C".
> > 
> > Is that true? I mean even if D reaches 90% of C's performance, I
> > still consider it great because of its productive features, but are
> > there any benchmarks done?
> 
> Not a statistically significant benchmark but an interesting data
> point:
> 
> C:
> 
> ==================== Sequential
> 	pi = 3.141592653589970752
> 	iteration count = 1000000000
> 	elapse time = 8.623442
> 
> C++:
> 
> ==================== Sequential
> 	pi = 3.14159265358997075
> 	iteration count = 1000000000
> 	elapse = 8.61212399999999967
> 
> D:
> 
> ======================== pi_sequential.d
> 	π = 3.141592653589970752
> 	iteration count = 1000000000
> 	elapse time = 8.612256
> 
> 
> C and C++ were compiled with GCC 4.8.1 full optimization, D was compiled
> with LDC full optimization. Oh go on, let's do it with GDC as well:
> 
> ======================== pi_sequential.d
> 	π = 3.141592653589970752
> 	iteration count = 1000000000
> 	elapse time = 8.616558
> 
> 
> And you are going to ask about DMD aren't you :-)
> 
> ======================== pi_sequential.d
> 	π = 3.141592653589970752
> 	iteration count = 1000000000
> 	elapse time = 9.495549
> 
> Remember this is 1 and only 1 data point and not even a sample just a
> single data point. Thus only hypothesis building is allowed, no
> deductions.  But I begin to believe that D is as fast as C and C++
> using GDC and LDC. DMD is not in the execution performance game.
[...]

This may be merely only a single isolated data point, but it certainly
matches my experience with GDC / DMD. I find that gdc -O3 consistently
produces code that outperforms code produced by dmd -O -inline -release.

As for comparison with C/C++, I haven't really tested it myself so I
can't say. But I *will* say that it's far easier to write casual code
(i.e., not hand-tuned for performance) in D that has similar performance
to the C/C++ equivalent.


T

-- 
Microsoft is to operating systems & security ... what McDonalds is to gourmet cooking.


More information about the Digitalmars-d mailing list