Changes between Version 18 and Version 19 of ProfilingDjango
- Timestamp:
- Aug 27, 2018, 10:58:26 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ProfilingDjango
v18 v19 7 7 I wrap views and other callables I want to examine in a decorator like this one: 8 8 9 {{{ 9 {{{python 10 10 import hotshot 11 11 import os … … 109 109 [http://djangosnippets.org/snippets/186/ Profiling Middleware] and [http://djangosnippets.org/snippets/605/ Extended Profiling Middleware] print profile results for method, additionally groups results by files and by modules. Add the "&prof=" query parameter and you'll see the profiling results in your browser. Unfortunately, these are both items on Django Snippets, so you should treat them as being untested abandonware, or, more charitably, example code. 110 110 111 There is another unofficial [http://www.no-ack.org/2010/12/yet-another-profiling-middleware-for.html profiling middleware], that attaches the profiler stats enclosed by a comment at the bottom of each HTML, XML and JSON document. That is useful in particular when profiling AJAX requests or when you want to watch the actual content and the profiler stats at the same time.112 113 111 [http://code.google.com/p/django-profiling/ django-profiling] seems to be another variant of the profiling middleware, which declares itself superseded by [http://code.google.com/p/django-logging/wiki/Overview django-logging], which declares itself unmaintained. 114 112 … … 158 156 }}} 159 157 160 == Other Approaches ==161 162 [http://www.mysoftparade.com/blog/django-profile-sql-performance/ django-profile.py] is a script that can be used to profile any Django-powered web-site and find how many SQL-queries are used per page, how heavy html-pages are, etc. See also [http://djangosnippets.org/snippets/461/ django snippet 461].163