Reputation: 151
I have a problem with my Django project. Currently I'm using Django 1.6, Python 3.3.3 sorl-thumbnail 12.0 and everything is really slow. I've spent the last 3 days in attempts to change it, but everything that I've tried, has had a very minor effect. Below are the numbers from the django-debug-toolbar:
User CPU time - 1976.123 msec
System CPU time - 176.011 msec
Total CPU time - 2152.134 msec
Elapsed time - 3671.669 msec
SQL - 25.95 ms (62 queries)
CACHE - 76 in 7.409811019897461 ms
Haystack query - 0.031ms
And the time, needed for the code in the view to be executed is 0.04816937446594238. The result was calculated in the following way:
import time
...
def base(request):
start_time = time.time()
#do something
end_time = time.time()
print(end_time - start_time)
return render(request, 'service/service.html', { 'services': services })
Can you please give me some advice on this? The db, static files, media files and elasticsearch are installed on my local machine. The DEBUG flag is True.
Edit 1: According to Tommaso answer, I have measured the time, needed for template rendering, and the result was awful - 3407.9 ms (using template_timings_panel for django_debug_toolbar). Also when I make a test with ab, on the same page, the time is not very different compared to the number above. Is it normal? What I can do to optimize it?
Upvotes: 1
Views: 1783
Reputation: 127
Upvotes: 4