Comment 8 for bug 1525156

Revision history for this message
Lars Karlitski (larsu) wrote :

We would have ended up with a separate library anyway, because we need something that doesn't depend on gtk.

I pondered splitting the non-gtk parts out of libtimezonemap at first, but decided to do a few more optimizations while I was at it:

1. throw away data in cities15000.txt that we don't need
2. compress the data and put into the .so, so that we don't need to open another file when accessing it
3. move searching for a city into its own thread, so that we don't block the UI (see bug #1367287)
4. not create a GObject for every city in the database

The library (including the data) is about half a megabyte now. It will grow by a bit more once I include translations, but it will stay under the 5 megabytes that libtimezonemap installs. I don't see any reason why the data should be shared. Just use the library if you need access to it. I also want to make it possible for us to change the way the data is stored to allow for more efficient lookups if we find out there's need for that.

The completion part of libtimezonemap indeed parses cities15000.txt on startup (and creates an object for each), but only ever uses it when the request to the web service fails.