On Wed, Apr 17, 2013 at 11:18 PM, Matt Andrews <[email protected]> wrote: > Hi all. > > Having performance problems with my Django app. I've posted here before > talking about this: one theory for my slowness woes was that I'm using raw > SQL for everything after getting sick of Django doing things weirdly > (duplicating queries, adding bizarre things like "LIMIT 3453453" to queries, > not being able to JOIN things like I wanted etc). I'm not opposed to going > back to the ORM but need to know if this is where my bottleneck is. > > I've run a profiler against my code and the results are here: > http://pastebin.com/raw.php?i=HQf9bqGp > > On my local machine (a not very powerful laptop) I see Django Debug Toolbar > load times of ~1900ms for my site homepage. This includes 168ms of db calls > (11 queries, which I think are fairly well-tuned, indexed, etc). I cache > pretty well on production but load times are still slow -- some of this may > be down to my cheap webhost, though. In my settings I enabled > django.template.loaders.cached.Loader but this doesn't seem to make much > difference. > > I'm having trouble seeing what the profiler results above are telling me: > can anyone shed any light?
Most of your time is spent in pprint, which was called over 14,000 times to generate your page. Over 2 seconds spent printing out debug. This should be telling you "don't use pprint when you want to see how fast your code is". Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

