After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790269 - consider dropping compressed=true for widget ui files
consider dropping compressed=true for widget ui files
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-11-12 23:35 UTC by Christian Hergert
Modified: 2018-05-02 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use xml-stripblanks and drop compression use for widgets (1.64 KB, patch)
2017-11-12 23:36 UTC, Christian Hergert
none Details | Review

Description Christian Hergert 2017-11-12 23:35:31 UTC
Currently, the gresource embedding of .ui files for widgets compresses the file (without stripping blanks first). Probably fine since the compression will run-length-encode the spaces anyway.

But there is a secondary issue here, in that it means we have to use a zlib decompressor when ever instantiating one of these widgets.

Gtk is mapped into many processes, and therefore the library size shouldn't be important enough to warrant the compression (plus packaging already compresses so users are unlikely to download any larger files).

I suggest we instead simply xml-stripblanks and stop using compression on the .ui files. It should (very slightly) speed up application startup, reduce our heap usage, and make widget creation faster.
Comment 1 Christian Hergert 2017-11-12 23:36:13 UTC
Created attachment 363459 [details] [review]
use xml-stripblanks and drop compression use for widgets
Comment 2 Tristan Van Berkom 2017-11-23 08:25:45 UTC
(In reply to Christian Hergert from comment #0)
[...]
> But there is a secondary issue here, in that it means we have to use a zlib
> decompressor when ever instantiating one of these widgets.

From what I recall discussing with Allison at the time, the above is not *entirely* true.

The activity of decompressing a GResource, should really only be happening the first time.

However, on a desktop like system as opposed to a kiosk/embedded scenario where one might run only a few applications for a long uptime, we should consider that the user spawns many separate applications and a *lot* of the time, when we instantiate a GTK+ widget on a desktop, it happens to be the first time in that executable's lifespan (so the effect for normal desktop GTK+ usage is as you describe).

That said, I seem to recall that Juan Pablo had been working on a much nicer approach for optimizing widget instantiation: Seeing as we now use GResources anyway, binary compatibility is not really an issue, so a binary format for GtkBuilder is quite possible. While we still have to retain some strings in order to cooperate with the GtkBuildable interface, we should be able to get a smaller binary footprint *and* completely side-step the XML parsing by encoding the preparsed XML binary structures directly into the GResource instead of XML.
Comment 3 GNOME Infrastructure Team 2018-05-02 19:27:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/975.