GNOME Bugzilla – Bug 720248
Search provider should link to fewer dependencies
Last modified: 2016-08-21 21:01:11 UTC
We are currently using almost the same libs than ephy itself. I should only link to a few external libs, like glib, but also it should use fewer internal deps which will also reduce the binary size.
(In reply to Carlos Garcia Campos from comment #0) > We are currently using almost the same libs than ephy itself. I should only > link to a few external libs, like glib, I don't really mind overlinking so much; avoiding that requires compiling the same source files multiple times, which we currently do not do anymore. If we give up on this goal... > but also it should use fewer > internal deps which will also reduce the binary size. ...then this becomes easy. By installing libephymain as a private shared library, we cut our installed size by roughly half. Current size on disk (without stripping debuginfo): prefix/bin/epiphany 2.8 MB prefix/libexec/epiphany-search-provider 2.8 MB prefix/libexec/epiphany/ephy-profile-migrator 320.2 kB prefix/lib/epiphany/libephywebextension.so 643.3 kB Total: 6.54 MB With libephymain as private shared lib: prefix/bin/epiphany 107.8 kB prefix/libexec/epiphany-search-provider 122.9 kB prefix/libexec/ephy-profile-migrator 320.2 kB prefix/lib/epiphany/libephywebextension.so 643.3 kB prefix/lib/epiphany/libephymain.so 2.8 MB Total: 3.97 MB If we additionally install libephymisc: jhbuild/bin/epiphany 107.8 kB jhbuild/libexec/epiphany-search-provider 122.9 kB jhbuild/libexec/ephy-profile-migrator 320.2 kB jhbuild/lib/epiphany/libephywebextension.so 214.7 kB jhbuild/lib/epiphany/libephymain.so 2.5 MB jhbuild/lib/epiphany/libephymisc.so 461.6 kB Total: 3.27 I tried installing libephyhistory as well (which is static linked into both ephy-profile-migrator.so and libephymain.so in the scheme above), but I didn't get any space savings. It's still maybe worthwhile, if we want to avoid unnecessary binary duplication. (The other internal libraries are all static linked to exactly once in the scheme above.) Thoughts?
Created attachment 332895 [details] [review] Install libephymain.so Instead of static linking it into both the epiphany and epiphany-search-provider binaries, install it as a private shared library. This cuts our installed size from 6.6 MB to 4.0 MB (before debuginfo is stripped) total. In particular, the epiphany and epiphany-search-provider binaries are now 0.1 MB apiece, from 2.8 MB apiece. The installed library takes 2.8 MB.
Created attachment 332896 [details] [review] Install libephymisc.so For additional space savings. This cuts our installed size from 4.0 MB down to 3.3 MB (before stripping debuginfo).
Created attachment 333842 [details] [review] Link libephyhistory.la directly into libephymisc.la This way, we don't need separate static copies of libephyhistory.la in both libephymain.la and epiphany-profile-migrator.
Attachment 332895 [details] pushed as 32e99b7 - Install libephymain.so Attachment 332896 [details] pushed as 7e705f6 - Install libephymisc.so Attachment 333842 [details] pushed as 74b907c - Link libephyhistory.la directly into libephymisc.la