On Wed, 2007-03-28 at 19:59 +0000, Milan Andric wrote: > Hellow, > > Any advice you can offer on optimizing this view would be greatly > appreciated. > > http://dpaste.com/7543/ > > I was planning on trying to reduce the amount of data in pForms, the > list that is passed to the template. Since i'm saving 19 > presentations into this list along with the forms, i'm assuming this > is the bottleneck. Any ideas how to work around this?
Don't assume... test! You can put calls to time.time() in various places in the view and then print out the differences between them to a file or to stderr (or even stdout if you are using the development server). That will show you which portions are taking the longest. With a few iterations, moving the time.time() calls around, you should be able to work out the exact lines that are taking the most time. Then come back and we can talk. You might discover, for example, that it's not the view that is taking all the time, but the template rendering for some reason (such as making a lot of database calls by constructing querysets whilst rendering the template). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---