Reordered class fields?

Simen Kjaeraas simen.kjaras at gmail.com
Mon Oct 22 00:44:36 PDT 2012


On 2012-36-22 01:10, bearophile <bearophileHUGS at lycos.com> wrote:

> This benchmark shows that if you allocate the class instances on the  
> heap one at a time the total amount of memory used is the same for the  
> various Bar (maybe because of the GC), so that optimization is useful  
> for emplace() only and similar in-place allocations

The current GC always allocates a power of two, with a minimum of 16
bytes. You should see an effect if you make a class that will be above
such a threshold without reordering, and below with.


> So is such class field reordering worth an enhancement request in  
> Bugzilla?

Nothing bad can come of it.

-- 
Simen


More information about the Digitalmars-d-learn mailing list