Moving to D

Steven Schveighoffer schveiguy at yahoo.com
Wed Jan 5 12:17:46 PST 2011


On Wed, 05 Jan 2011 14:53:16 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> bearophile wrote:
>> Often one of the most important things for speed is memory management, D
>> encourages to heap allocate a lot (class instances are usually on the  
>> heap),
>> and this is very bad for performance,
>
> 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.

In practice, it turns out D's GC is pretty bad performance-wise.  Avoiding  
using the heap (or using the C heap) whenever possible usually results in  
a vast speedup.  This is not to say that the GC concept is to blame, I  
think we just have a GC that is not the best out there.

It truly depends on the situation.  In something like a user app where the  
majority of the time is spent sleeping waiting for events, the GC most  
likely does very well.

I expect the situation to get better when someone has time to pay  
attention to increasing GC performance.

-Steve


More information about the Digitalmars-d mailing list