[QGIS-Developer] Profiler?
Nathan Woodrow
madmanwoo at gmail.com
Sat May 23 05:18:41 PDT 2020
Correct. QgsRuntimeProfiler is the tool that can do it.
https://qgis.org/api/classQgsRuntimeProfiler.html
In Python you can access it using this:
QgsApplication.instance().profiler()
An example:
QgsApplication.instance().profiler().start("my_thing")
# long expensive stuff
QgsApplication.instance().profiler().end()
On Sat, May 23, 2020 at 9:38 PM Richard Duivenvoorde <rdmailings at duif.net>
wrote:
> On 5/23/20 11:42 AM, Sebastian M. Ernst wrote:
>
> > @Richard How does your Citrix setup / architecture look like
> > (approximately)?
>
> I'll ask around for more details, as I'm there just as a user of that
> setup.
>
> But I did try a lot of things: and exactly what you tell: their virus
> scanner was pushing some hash version of all python files to some online
> service. So I disabled it...
> But still... And off course they are working with some network shares,
> so I will try out some of your other idea's
>
> > @Nathan & @Nyall Where in QGIS' source can I find the profiling tool? I
> > just searched and could not locate it ... Would you consider adding
> > support for a Python profiler to it, e.g. [1], [2] or [3]? The relevant
> > code could (conditionally) be injected somewhere around here [4] or here
> > [5]. I have played with this idea a while ago. It works in principle,
> > but a proper integration into your GUI would be great ...
>
> In my debug build, using
> export QGIS_DEBUG=5
>
> I see:
>
> ../src/core/symbology/qgssymbollayerutils.cpp:3936 :
> (svgSymbolNameToPath) [0ms] Svg found in alternative path
> ../src/core/qgsruntimeprofiler.cpp:80 : (end) [0ms] PROFILE: Load
> default style database/Load symbols/topo camp - 0.001
> ../src/core/qgsruntimeprofiler.cpp:80 : (end) [0ms] PROFILE: Load
> default style database/Load symbols/topo foot - 0
> ../src/core/qgsruntimeprofiler.cpp:80 : (end) [0ms] PROFILE: Load
> default style database/Load symbols/topo forest - 0
>
> So:
> https://github.com/qgis/QGIS/blob/master/src/core/qgsruntimeprofiler.cpp
> :-)
>
> Regards,
>
> Richard Duivenvoorde
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200523/d98d8f02/attachment-0001.html>
More information about the QGIS-Developer
mailing list