This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Statistics for varray GGC memory consumption


On Mon, 2004-01-19 at 16:26, Jan Hubicka wrote:
> > On Mon, 2004-01-19 at 08:45, Jan Hubicka wrote:
> > > 
> > > Hi,
> > > I am somewhat concerned about use of varrays in GGC memory that produce
> > > relatively large amount of garbage (a lot of that without good reason as
> > > we can use malloc scheme instead, just we don't), thus I've implemented
> > > statistics routines.  Quick checking found that for Geralds testcase
> > > does about 13MB of varrays, while tree-SSA does 63MB.  The average
> > > overhead per varray is over 10KB so operands are not to blame here IMO.
> > > 
> > 
> > What operands do you refer to? ssa operands are no longer using varrays,
> > so they wouldnt be a factor anyway.
> I referred to operands, but obviously these are not a problem anymore.
> I am getting following statistics and I am working on patch to allow
> varrays be allocated either by malloc or ggc.
> As you can see, we seem to waste more memory in varrays that we do for
> RTL.
> 

We use to be very varray happy. I have removed a bunch of them. We are
still varray happy in a few places, and we oughta find them and fix
those spots. It would be interesting to see how these numbers change as
we turn off individual optimizations to see how much each one uses, and
how much is infrastructure. (Or simply print these stats after each
pass). It would quickly become obvious which passes are varray abusers
:-)

I ended up not using it for operands, but I did have a segmented array
implementation that worked just like varrays only removed the
requirement that the array have contiguous memory. (ie, If its always
accessed via macro) There were a lot of places where this didnt matter,
and as the varray grows large, we may spend a lot of time doing copy via
realloc in order to keep the array contiguous. There may be also places
which might benefit from such a thing...  

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]