<br><br><div class="gmail_quote">2011/1/6 Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">bearophile wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Adrian Mercieca:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
How does D square up, performance-wise, to C and C++ ? Has anyone got any<br>
benchmark figures?<br>
</blockquote>
<br>
DMD has an old back-end, it doesn't use SSE (or AVX) registers yet (64 bit<br>
version will use 8 or more SSE registers), and sometimes it's slower for<br>
integer programs too.<br>
</blockquote>
<br></div>
The benchmarks you posted where it was supposedly slower in integer math turned out to be mistaken.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I've seen DMD programs slow down if you nest two<br>
foreach inside each other. There is a collection of different slow<br>
microbenchmarks.<br>
<br>
But LDC1 is able to run D1 code that looks like C about equally fast as C or<br>
sometimes a bit faster.<br>
<br>
DMD2 uses thread local memory on default that in theory slows code down a bit<br>
if you use global data, but I have never seen a benchmark that shows this<br>
slowdown clearly (an there is __gshared too, but sometimes it seems a<br>
placebo).<br>
<br>
If you use higher level constructs your program will often go slower.<br>
</blockquote>
<br></div>
Rubbish. The higher level constructs are "lowered" into the equivalent low level constructs.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Often one of the most important things for speed is memory management, D<br>
encourages to heap allocate a lot (class instances are usually on the heap),<br>
and this is very bad for performance,<br>
</blockquote>
<br></div>
That is not necessarily true. Using the gc can often result in higher performance than explicit allocation, for various subtle reasons. And saying it is "very bad" is just wrong.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
also because the built-in GC doesn't<br>
have an Eden generation managed as a stack. So if you want more performance<br>
you must program like in Pascal/Ada, stack-allocating a lot, or using memory<br>
pools, etc. It's a lot a matter of self-discipline while you program.<br>
</blockquote>
<br></div>
This is quite wrong.<br>
</blockquote></div><br>I using D for 3 years . I am not in newsgroup because my English is very pool .<br>D is <span class="enfont">excellent , I try it with Libevent,  Libev,  pcre, sqlite,  c-ares, dwt, and a lot other amazing Lib. It work great with C-lib .   I enjoy it so much .<br>
My work is a web developer, I also try use D in web field ,  It not result well .<br><br>Adam D. Ruppe post some </span><span class="enfont">interesting cod in here , And I find a lot people  try in web field. for example: (mango, </span><a href="https://github.com/temiy/daedalus">https://github.com/temiy/daedalus</a>, Sendero  ... <span class="enfont">)   , But in the end I had to say, most D project is dying .<br>
<br>D like a beautiful girl friends,  You play with her can have a lot of fun.  But she is be scared to make promisee ,   you can't count your life on it. she is not a good </span><span id="result_box" class="short_text" lang="en"><span title="点击可显示其他翻译" class="hps">potential</span> <span title="点击可显示其他翻译" class="hps">marriage</span></span> .  her life is still in mess, and day after day she is more smart but <span id="result_box" class="short_text" lang="en"><span title="点击可显示其他翻译" class="hps">not</span> <span title="点击可显示其他翻译" class="hps">become more mature.</span></span>    so if you want do some <span id="result_box" class="short_text" lang="en"><span title="点击可显示其他翻译" class="hps">serious</span></span> work ,  You'd better choose another language.  if you just wan fun , D is a good  companion .<br>
<br><br><br><br><span class="enfont"><br><br></span>