Performance Profiling with Pyinstrument

The Python package Pyinstrument can be added to GovReady-Q to profile performance issues within the code.

Pyinstrument includes a Django middleware that when added to GovReady-Q’s siteapp/ file enables displaying of profile results directly in the browser.

Use Pip to install Pyinstrument Python package.

pip install pyinstrument

Add pyinstrument.middleware.ProfilerMiddleware to siteapp/


Restart GovReady-Q server.

Once installed, add ?profile to the end of a request URL to activate the profiler (or &profile if URL already includes GET params).

If you wish to profile every request, make sure to set your profiles directory in your


The HTML documents generated will be in the designated profiles folder which will be instantiated if there is not already one in your working directory.

See Pyinstrument Profile a web request in Django for more details.