[QGIS-Developer] Profiler?

Sebastian M. Ernst ernst at pleiszenburg.de
Sun May 24 13:50:53 PDT 2020


Hi all,

> [...]
> https://gitlab.com/GIS-projects/Plugin-Load-Times
> [...]
>
>     Or the newer, more Pythonic  way:
>
>        with QgsRuntimeProfiler.profile('loading something'):
>           # do some stuff
>
>     I'd encourage plugin authors to use this in their plugins
>     initialisation code as much as makes sense!

ah, ok - this was not *quite* what I meant.

It's actually possible to use Python's cProfile for better understanding
the *entire* QGIS Python mechanism and its issues - e.g. on startup on
"interesting" Windows deployments. I have just injected cProfile into
QGIS' startup code and visualized its output (on Linux), see here:

http://static.pleiszenburg.de/qgis/qgis_startup_cprofile.png

I'd be *very* interested in seeing something similar coming from Windows
boxes with slow QGIS startup times. If I had to bet, I'd expect
anomalies (i.e. high runtimes) in the CPython interpreter's module
import mechanism.

Best regards,
Sebastian


More information about the QGIS-Developer mailing list