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
python django


source to share


No one has answered this question yet

Check out similar questions:

1183
How can you profile a Python script?
817
Django scale?
794
differentiate null = True, blank = True in django
555
How to debug in Django, a good way?
130
Reducing Django memory usage. Low hanging fruit?
36
Django Debug Toolbar: Understanding the Timebar
3
Django profiling
3
Django Tastypie Postgres slow server response
0
Django profiling: very poor performance
0
Refreshing the page increases request size, cpu time and context switches in Django. Why is this happening?



All Articles
Loading...
X
Show
Funny
Dev
Pics