Newsgroups, off-topic

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 23 09:14:36 PDT 2010


On Fri, 23 Apr 2010 11:55:42 -0400, Joseph Wakeling  
<joseph.wakeling at webdrake.net> wrote:

> Steven Schveighoffer wrote:
>> Personally, I am not too concerned about the backend performance, it's
>> not critical to D at this time.  Someone, somewhere, will make this
>> better, and then any code written in D magically gets faster :)  We're
>> talking about decreasing the constant for the D compiler complexity, not
>> decreasing the complexity.  Code built with dmd runs plenty fast for me
>> (save the GC performance, maybe we can focus on that first?).
>
> I'm looking forward to seeing gdc released for D2 -- I think it will be
> interesting to compare.  From what I understand part of the motivation
> for reawakening it was a comparison of performance of code generated by
> llvm and gcc respectively.

ATM, the bottleneck almost always is the GC.  And the gdc GC is the same  
as the dmd GC, meaning you'll get the same relative performance.  Like I  
said, you are decreasing the constant, not the complexity.  Creating a  
better GC algorithm would be a more effective speedup.  I think LLVM has  
its own GC, so that might be significantly different.

> Part of my original issue over speed was that I'd heard D described as
> 'performance already as good as C++'.  So, I was coming with
> expectations about what I'd be able to achieve ... :-)

As long as you discount the vast differences in allocation performance,  
the code generated should be just as good as code generated by a C++  
compiler.  Your interpretation of performance did not focus on the right  
part :)  Your test application heavily used allocation and reallocation,  
things that have nothing to do with how fast the code compiled by the  
compiler is, but are based more on the algorithms behind the allocation.   
An equivalent C++-based GC would probably show similar performance (in  
fact, I think D's GC was based on a C++ GC).

This is all taken with a grain of salt of course, the perception is often  
more important than the technical details.  This thread being a prime  
example of it.

How I would characterize D when talking about performance is that it is  
possible to make it as high-performing as C++, but often favors memory  
safety over performance.  As far as syntax, D wins that battle hands down  
IMO.  And syntax is way more important to me than performance, especially  
at this stage of D's life.  Performance can always be tweaked and improved  
with few changes to the source code, but syntax changes can force you to  
have to modify an entire program.

-Steve


More information about the Digitalmars-d-learn mailing list