[QGIS-Developer] PSA: Use of Hotspot to find performance bottlenecks

Nyall Dawson nyall.dawson at gmail.com
Thu Jun 7 16:38:08 PDT 2018


Hi all,

Thought I'd give a bit of a "heads-up" regarding a tool I've been
using a lot recently to find performance bottlenecks in QGIS code.

The tool is hotspot - https://github.com/KDAB/hotspot . It's a
graphical frontend to the kernel perf tool (so linux only). What makes
it really easy to use is the different views it provides to the perf
reports. I've especially found the "flamegraph" view to be very
helpful at tracking down bottlenecks.

To use it, you launch QGIS and get ready to run the process you want
to profile. Then from hotspot, you run the File - Record Data command,
and attach to the running QGIS process. Flick back to QGIS, do some
stuff, and return to hotspot and Stop Recording then View Results...
and fingers crossed, you'll find some nice and easy bottlenecks to
fix.

I've tried other tools like this in the past, but found hotspot is the
easiest to to use because it doesn't require any compilation changes,
you can attach to already running applications, and because the
supplied views are very helpful.

I think the server team especially may find this beneficial during
their current hunt on server performance regressions!

Nyall


More information about the QGIS-Developer mailing list