Re: render_to_response taking 50 seconds!

2009-11-11 Thread Carl Zmola
Did you isolate the problem yet? It could also be the query itself. You might have to add indexes into the database to get good results. How much time does the query take if you run it in naive SQL without the rendering? Low Kian Seong wrote: > Pretty much confirmed it's the rendering or pul

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Low Kian Seong
On 11/3/09, esatterwh...@wi.rr.com wrote: > > You might want to consider installing the debug toolbar ( > http://github.com/robhudson/django-debug-toolbar ). Yeah, I tried this before but then when you are trying to generate an Excel spreadsheet somehow it fails to capture the right data and dis

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Михаил Лукин
I strongly suggest you to use pagination here. 2009/11/3 Low Kian Seong > > I have about 3k plus record in my db table and am trying to do a > simple render_to_response of a template sending it the results of a > query. I debugged this and found that the total time taken for an > operation like

Re: render_to_response taking 50 seconds!

2009-11-03 Thread bruno desthuilliers
On 3 nov, 12:12, Low Kian Seong wrote: > Pretty much confirmed it's the rendering or pulling of data from database: > > 1. I tried to render a html page instead of Excel. Same speed. > So this > kicks out the theory of rending of excel is slowing the page down. I assume you meant "csv", not "Exc

Re: render_to_response taking 50 seconds!

2009-11-03 Thread esatterwh...@wi.rr.com
You might want to consider installing the debug toolbar ( http://github.com/robhudson/django-debug-toolbar ). it displays the amount of time taken for all of the rendering steps. It will defiantly help you narrow down the major culprits. On Nov 3, 5:12 am, Low Kian Seong wrote: > Pretty much co

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Low Kian Seong
Pretty much confirmed it's the rendering or pulling of data from database: 1. I tried to render a html page instead of Excel. Same speed. So this kicks out the theory of rending of excel is slowing the page down. 2. I tried shorting out all the data from the rendered page. Page came up in less t

Re: render_to_response taking 50 seconds!

2009-11-03 Thread bruno desthuilliers
On 3 nov, 09:09, Low Kian Seong wrote: > But I am confused here. How do iterate through the data another time? > Do I call the select_related in my views.py code like: > > manager_info = found_entries.select_related() > > then how do i iterate through manager_info in my template? That's not how

Re: render_to_response taking 50 seconds!

2009-11-03 Thread James Bennett
On Tue, Nov 3, 2009 at 1:17 AM, Low Kian Seong wrote: > There is a query page where the start_date and end_date is being sent. > Then the do_defender_advanced will process it and generate an Excel > using the template. One other thing is that the Django template system isn't really optimized for

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Low Kian Seong
On Tue, Nov 3, 2009 at 3:41 PM, James Bennett wrote: > > On Tue, Nov 3, 2009 at 1:17 AM, Low Kian Seong wrote: >> There is a query page where the start_date and end_date is being sent. >> Then the do_defender_advanced will process it and generate an Excel >> using the template. > > For each obje

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Low Kian Seong
But I am confused here. How do iterate through the data another time? Do I call the select_related in my views.py code like: manager_info = found_entries.select_related() then how do i iterate through manager_info in my template? On Tue, Nov 3, 2009 at 3:46 PM, Jani Tiainen wrote: > > Your mode

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Jani Tiainen
Your model was not-so-good Python/Django code style so it was bit hard to read but... Low Kian Seong kirjoitti: > On Tue, Nov 3, 2009 at 3:07 PM, Jani Tiainen wrote: >> Low Kian Seong kirjoitti: >>> On Tue, Nov 3, 2009 at 1:33 PM, Jani Tiainen wrote: Low Kian Seong kirjoitti: > I have

Re: render_to_response taking 50 seconds!

2009-11-02 Thread James Bennett
On Tue, Nov 3, 2009 at 1:17 AM, Low Kian Seong wrote: > There is a query page where the start_date and end_date is being sent. > Then the do_defender_advanced will process it and generate an Excel > using the template. For each object you are displaying the values of four foreign keys. Each time

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Low Kian Seong
On Tue, Nov 3, 2009 at 3:07 PM, Jani Tiainen wrote: > > Low Kian Seong kirjoitti: >> On Tue, Nov 3, 2009 at 1:33 PM, Jani Tiainen wrote: >>> Low Kian Seong kirjoitti: I have about 3k plus record in my db table and am trying to do a simple render_to_response of a template sending it the

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Jani Tiainen
Low Kian Seong kirjoitti: > On Tue, Nov 3, 2009 at 1:33 PM, Jani Tiainen wrote: >> Low Kian Seong kirjoitti: >>> I have about 3k plus record in my db table and am trying to do a >>> simple render_to_response of a template sending it the results of a >>> query. I debugged this and found that the t

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Low Kian Seong
On Tue, Nov 3, 2009 at 1:33 PM, Jani Tiainen wrote: > > Low Kian Seong kirjoitti: >> I have about 3k plus record in my db table and am trying to do a >> simple render_to_response of a template sending it the results of a >> query. I debugged this and found that the total time taken for an >> oper

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Javier Guerra
On Mon, Nov 2, 2009 at 10:44 PM, Low Kian Seong wrote: > I have about 3k plus record in my db table and am trying to do a > simple render_to_response of a template sending it the results of a > query. I debugged this and found that the total time taken for an > operation like this is 50 seconds!

Re: render_to_response taking 50 seconds!

2009-11-02 Thread Jani Tiainen
Low Kian Seong kirjoitti: > I have about 3k plus record in my db table and am trying to do a > simple render_to_response of a template sending it the results of a > query. I debugged this and found that the total time taken for an > operation like this is 50 seconds! Is there anyway to speed this

render_to_response taking 50 seconds!

2009-11-02 Thread Low Kian Seong
I have about 3k plus record in my db table and am trying to do a simple render_to_response of a template sending it the results of a query. I debugged this and found that the total time taken for an operation like this is 50 seconds! Is there anyway to speed this up? -- Low Kian Seong blog: http