Django slow query profiling / debugging

I have a page running on my local django dev server with the Django Debug toolbar, which is quite slow, but I'm not sure why:

Django Debug Toolbar says

Resource    Value
User CPU time   1317.854 msec
System CPU time 191.942 msec
Total CPU time  1509.796 msec
Elapsed time    1473.806 msec
Context switches    6 voluntary, 16842 involuntary

      

SQL - 46 queries in 39.80ms

And then run the profiler https://sourcegraph.com/github.com/shaunsephton/django-snippetscream/.PipPackage/django-snippetscream/.def/snippetscream/_186/ProfileMiddleware

I am getting 7926 function calls (7774 primitive calls) in 0.024 seconds

So, I am left to wonder why the profile time is much less than the total processor time?

And how can I find out what is causing the difference?

And on a side note - should I be worried about involuntary context switches 16842 !?

+3


source to share





All Articles