the List example
Leandro Lucarella
llucax at gmail.com
Fri Nov 6 05:29:27 PST 2009
Max Samukha, el 6 de noviembre a las 11:10 me escribiste:
> On Thu, 5 Nov 2009 21:29:43 -0300, Leandro Lucarella
> <llucax at gmail.com> wrote:
>
> >See my other response about efficiency of D when using new/classes a lot.
> >You just can't do it efficiently in D, ask bearophile for some benchmarks
> >;)
>
> This is in part because D doesn't have a compacting GC. A compacting
> GC implies allocation speeds comparable with the speed of allocation
> on stack. I guess many bearophile's benchmarks do not account for GC
> collection cycles, which should be slower in C#/Java because of the
> need to move objects. I think, fair benchmarks should always include
> garbage collection times.
I don't think it's slower, because GCs usually treat differently small and
large objects (the D GC already does that). So very small objects (that
are the ones more likely to get allocated and freed in huge ammounts) are
copied and large objects usually not. Moving a small object is not much
more work than doing a sweep, and you get the extra bonus of not having to
scan the whole heap, just the live data. This is a huge gain, which make
moving collectors very fast (at the expense of extra memory since you have
to reserve twice the programs working set).
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Dale tu mano al mono, pero no el codo, dado que un mono confianzudo es
irreversible.
-- Ricardo Vaporeso. La Reja, Agosto de 1912.
More information about the Digitalmars-d
mailing list