This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.0 Status Report
Daniel Berlin <dberlin@redhat.com> writes:
> Most of the 4 seconds seems to get spent in a GC right after it sees
> the first thing in the implementation (I assume it's starting to
> lazy load things from the PCH headers at this point and there is a
> ggc_collect where it isn't the best idea anymore, or PCH is creating
> a lot of objects that aren't goint to be gotten rid of, since the GC
> reclaims just about nothing).
Yes, what happens is that the PCH machinery reads zillions of objects
from the file, and then the very next time that ggc_collect is called
it sees that lots of memory has been allocated and it tries to
collect. Of course, this is never going to be helpful, since all of
those zillions of objects are referenced otherwise they wouldn't have
been saved in the first place.
Probably the thing to do is to have the PCH machinery add to
G.allocated_last_gc the size of the objects it allocates, because it
knows those objects will not be collectable before the next
ggc_collect().
There's no lazy loading yet. Everything is loaded in at once. That's
one of the reasons I'm so impressed with the big speed increase, that
was the kind of increase we were hoping to get out of PCH+lazy loading.
--
- Geoffrey Keating <geoffk@geoffk.org>