[Qgis-developer] Perfs: a lot of WKB conversions

Patrick Valsecchi patrick.valsecchi at camptocamp.com
Tue Jul 19 02:30:30 PDT 2016


Hi Martin,

On Tue, Jul 19, 2016 at 10:52 AM, Martin Dobias <wonder.sk at gmail.com> wrote:

> Just curious - what did you use for profiling? Release or Debug build?
>

When trying to optimize code like QGIS server, I tend to do that:

   1. Take a scenario that matches the realworld, run it with a RELEASE
   build on a machine matching somehow what is the usual production machine,
   then:
      1. do a warmup round to make sure the stuff as reached cruise speed
      and throw away the measurements.
      2. measuring global real times for several queries (2 minutes full
      speed) and look at the average response time and the distribution.
      2. I did the same measurements for other servers (MapServer and
   GeoServer), just for reference.
   3. When that is done, and only when that is done, I take a single query,
   that I run against QGIS compiled in DEBUG (to have symbols and to be able
   to follow what's happening) and run it under valgrind (callgrind mode).
   4. Then, after identifying trouble zones, I change the code and run step
   1 to see if there is any change. Keep the change if the improvement is
   measurable worth the added complexity.
   5. Repeat step 3 until you run out of budget and/or the improvements are
   becoming too small to be measured.

So yes, my per function numbers are not very accurate, but they are a very
good indication of where time is spent. But, I still have the global
numbers with a RELEASE build to see if changes are improving things.


> Sounds quite interesting - would be good to get some numbers how much
> this would help.
>

My plan is to find some time to do that. It shouldn't take too much time.


> Yes, but obviously the results from profiling vary quite a lot
> depending on provider type and used symbology.
>

The provider, at least PostGIS on the same machine, is not contributing too
much on the time spent to do a simple GetMap, from what I've seen. But yes,
when optimizing, you have to choose a scenario and it impacts a lot what
you see.

Thanks for the history lesson. It's always interesting to understand from
where a code comes from.

CU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160719/7bd7f88f/attachment-0001.html>


More information about the Qgis-developer mailing list