[cfe-dev] Question about optimization of new and delete

Hal Finkel hfinkel at anl.gov
Mon Sep 30 22:48:23 PDT 2013


----- Original Message -----
> 
> Il giorno 30/set/2013, alle ore 15:11, Hal Finkel <hfinkel at anl.gov>
> ha scritto:
> > 
> > The criteria have not yet been decided, and I think some
> > experimentation will be necessary. In the current implementation,
> > the conversion happens for all allocations provably less than 1024
> > bytes. However, we may want to cap the total size of converted
> > mallocs in addition to, or instead of, the individual sizes. Maybe
> > this cap should depend on how much stack memory is already being
> > requested by the function. I'm certainly open to suggestion.
> > 
> 
> Capping the total size seems more reasonable to me, but as you said,
> it's necessary to experiment.
> Anyway, I was thinking about a tradeoff between stack usage and speed
> based on the "hotness" of the code (how to call it?). For example a
> relatively big allocation inside a tight loop might be lowered while
> an allocation of the same size at function scope would not.
> Also, I think the function being recursive and/but getting
> transformed by tail call elimination should be factors to take into
> account.
> 
> What do you think?

These all seem like good ideas; once the initial support lands upstream, please play with it. I think that user feedback is really going to be the only way to set these various thresholds.

 -Hal

> 
> > 
> > Is there a call to the destructor after the store? If so, then we
> > might not know that the destructor does not access the stored
> > value.
> > 
> 
> No there's not. The issue exists with an empty class with only the
> member.
> 
> 
> Thanks,
> Nicola

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list