On Mon, Nov 2, 2009 at 10:44 PM, Low Kian Seong <django....@gmail.com> 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! Is there anyway to speed this up?
not sure if it would make any difference; but the first thing i would try is to not directly use a template; instead create a response object and write to it as a file-like object. maybe you could load a single-record template, and render each db record to the response, roughly: template = load template response = httpresponse() for record in queryset: response.write (template.rendertostring (record) return response i'm not sure; but this might let the response object stream the data, greatly reducing ram pressure. -- Javier --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---