Re: avoiding relocations in type registration



On 4/4/06, Andy Wingo <wingo pobox com> wrote:
> Hi Matthias,
>
> On Mon, 2006-04-03 at 13:53 -0400, Matthias Clasen wrote:
> > GType
> > g_type_register_static_simple (GType             parent_type,
> >                              const gchar      *type_name,
> >                                guint16           class_size,
> >                                GClassInitFunc    class_init,
> >                                guint16           instance_size,
> >                                GInstanceInitFunc instance_init,
> >                                GTypeFlags        flags);
>
> GStreamer also uses base_init; would you recommend rolling our own
> register_static variant?
>

I don't really have a recommendation at this point, still collecting numbers.
Here is what I get from converting some smaller libraries to
g_type_register_simple:

gdk-pixbuf before:
   text    data     bss     dec     hex filename
  84273    1300     156   85729   14ee1 .libs/libgdk_pixbuf-2.0.so

gdk-pixbuf after:
   text    data     bss     dec     hex filename
  84196    1040     156   85392   14d90 .libs/libgdk_pixbuf-2.0.so

gdk before:
   text    data     bss     dec     hex filename
 547270   10476     580  558326   884f6 .libs/libgdk-x11-2.0.so

gdk after:
   text    data     bss     dec     hex filename
 547565    9456     580  557601   88221 .libs/libgdk-x11-2.0.so

I expect the savings to be a bit larger for GTK+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]