Group static constructors and destructors in specific subsections
Jan Hubicka
hubicka@ucw.cz
Fri Oct 15 16:54:00 GMT 2010
> On 10/14/2010 10:38 PM, Jan Hubicka wrote:
> > Together with linker script update (attached at binutils side) this cause
> > significant improvements in the startup time (40% of Mozilla's binary startup
> > is paging in hundreds of static constructors evenly spred across the binary).
> >
> Thanks for the great work. Then I understand the libstdc++ cases are
> automatically dealt with correctly and we don't have to do anything
> special at the library level, right? I mean with reference to the PR
> which you opened some time ago...
Hi,
to get the constructors grouped, there should be no need for any source file
updates. Libstdc++ has only about 8 static constructors (guessing from ctor
section), so the gains on libstdc++ startup will be limited however.
We still have isue with including iostream causing static constructor that is bit
careless. Now hever the constructors will all sit in the same section that will
be paged in quite effecitvely at startup. Chrome is told to have about 1300 of such
constructors, so it will account from few extra KB at startup read in sequence, but
backward. Should not be disasterous, still something more effective would be nice.
Honza
>
> Thanks,
> Paolo.
More information about the Gcc-patches
mailing list