GNOME Bugzilla – Bug 769417
Download tiles in parallel and/or use HTTP pipelining or HTTP/2
Last modified: 2016-08-02 20:39:06 UTC
Currently slow loading of tiles in gnome-maps due to proxying (https://bugzilla.gnome.org/show_bug.cgi?id=769352), revealed another performance issue: Loading of tiles happens serially, i.e. one after the other. Given the overhead of http, performance would downloading tiles in parallel. Multiple solutions seem feasible: Starting download of multiple tiles in parallel, HTTP pipelining, or HTTP/2 may increase performance and reduce overhead.
Tiles aren't loaded sequentially - libchamplain supports parallel loading of tiles. However, OSM usage policy here http://wiki.openstreetmap.org/wiki/Tile_usage_policy requires that we load at most two tiles in parallel so libchamplain restricts the number of libsoup threads to two here: https://github.com/GNOME/libchamplain/blob/master/champlain/champlain-network-tile-source.c#L285 The last time I just experimentally played with the number and increased it to something bigger the parallel loading worked just fine (and was indeed faster) until the OSM server detected that after which it blocked all the traffic for me for several minutes. The thing that could be improved though is we could have a configurable number of threads per tile source (different ones could allow more connections in parallel) - right now all tile sources are restricted to 2 threads (see https://bugzilla.gnome.org/show_bug.cgi?id=768890)
Regarding HTTP/2 as far as I know OSM doesn't allow connections over SSL so it won't work. I'm not sure if libsoup which we use for the HTTP requests supports pipelining - I haven't found anything when searching for it (let me know if you found something). Also, I'm not sure if OSM servers support HTTP pipelining.