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 547961 - /usr/share/libgweather/locations.xml is 17 megabytes!!!!
/usr/share/libgweather/locations.xml is 17 megabytes!!!!
Status: RESOLVED FIXED
Product: libgweather
Classification: Core
Component: locations
unspecified
Other Linux
: Normal critical
: 2.22.0
Assigned To: libgweather-maint
libgweather-maint
: 161945 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-15 20:41 UTC by Jim Gettys
Modified: 2008-08-15 22:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Jim Gettys 2008-08-15 20:41:00 UTC
For localized place names.......

This is insane...

oink, oink, oink...  This is the sound of gnome starting up, reading 17 megabytes of XML, and parsing it, as gnome panel starts the time applet, which loads gweather, which, to provide cute logos of sunny, cloudy or other weather conditions on its display, reads this 17 megabyte file.

And this is for 72 languages...  
There are > 350 languages of more than 1 million speakers in the world (ref:630 ethnologue).  And we already have examples of smaller languages having been localized (e.g. icelandic, welsh). There are about 6000 languages spoken in the world today....

So just for the set of 350 languages, we can expect this file to grow to about 70 megabytes....

Can I suggest we have a better localization strategy?  Pretty Please?  Or we'll run out of RAM and die of old age starting up such features...
Comment 1 Matthias Clasen 2008-08-15 21:29:46 UTC
intltool makes this situation much worse than it needs to be.
See these intltool bugs:

http://bugzilla.gnome.org/show_bug.cgi?id=421155
http://bugzilla.gnome.org/show_bug.cgi?id=474987
Comment 2 Behdad Esfahbod 2008-08-15 21:33:39 UTC
Humm, why's mine only 1mb?
Comment 3 Behdad Esfahbod 2008-08-15 21:35:47 UTC
Since gweather is a service that requires internet anyway, can't it do its search, etc remotely and only store XXML info for user's configured locations?
Comment 4 Behdad Esfahbod 2008-08-15 21:39:00 UTC
$ rpm -qf /usr/share/libgweather/Locations.xml 
libgweather-2.23.6-1.fc10.i386

Also, why does it have such places like Constantine?!  The representation also looks redundant.  I don't know what each field means, but this certainly can be optimized:

<city>
  <name>Constantine</name>
  <coordinates>36-21-54N 006-36-52E</coordinates>
  <location><name>Constantine</name><code>DABC</code><coordinates>36-16-59N 006-37E</coordinates></location>
</city>

Also, using more compact entity names can easily save some 30% to 50% it seems.
Comment 5 Dan Winship 2008-08-15 21:39:40 UTC
In 2.23, the default is to build a separate Locations.XX.xml for each language, rather than including all languages in a single file.

Also, AFAIK, the clock does not read in Locations.xml until you open the Add/Edit location dialog.
Comment 6 Dan Winship 2008-08-15 21:40:45 UTC
(there are also other bugs about using a more compact representation in general)
Comment 7 Behdad Esfahbod 2008-08-15 21:48:18 UTC
*** Bug 161945 has been marked as a duplicate of this bug. ***