Newsgroups, off-topic

Joseph Wakeling joseph.wakeling at webdrake.net
Fri Apr 23 09:28:55 PDT 2010


Steven Schveighoffer wrote:
> 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.

I do see the point about allocation and reallocation -- what was
bothering me a bit was that even taking those aspects out of the code
and preallocating everything, I could write C++ code that _didn't_
preallocate and still ran (much) faster ... :-)

> 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.

Certainly agree about syntax -- it was not quite love at first sight,
but close.  In my case performance matters a lot, safety somewhat less
-- since I'm used to taking responsibility for it myself, and my
programming is quite small-scale.

As for perception, my perception is that I like D a lot and will surely
be using it more in future... :-)


More information about the Digitalmars-d-learn mailing list