Hit send too soon: https://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching
On Thu, Apr 18, 2013 at 8:39 AM, Shawn Milochik <[email protected]> wrote: > Yes, it does look like template tags are taking some time. Is the page > huge? Are you doing a ton of formatting? Is there something you could maybe > move to server-side? > > Also, this might help with caching bits of your output: > > > On Thu, Apr 18, 2013 at 6:17 AM, Matt Andrews <[email protected]>wrote: > >> >> On Thursday, 18 April 2013 10:45:40 UTC+1, Tom Evans wrote: >> >> 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<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 >>> >> >> Good point Tom, apologies. Here's the profiler results with DebugToolbar >> switched off (and ordered by cumulative time, thanks Shawn!): >> http://pastebin.com/raw.php?i=y3iP0cLn >> >> The top one is obviously my "home" method inside my views, but I'm >> struggling to get more from it than that. Lots of template rendering, but >> caching not helping here...? >> >> -- >> 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. >> >> >> > > -- 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.

