Version 3 (modified by Piotr Maliński <riklaunim@…>, 12 years ago) (diff)


django.core.handlers.profiler-hotshot provides profiling support for Django when using mod_python. Here's a similar solution for the internal development webserver. Hotshot generates logs that can be also used by aplication like kcachegrind. Read Django profiling with hotshot and kcachegrind for more details.

Apply the included patch to django/core/ and start Django with runserver. Each request will create a .prof file in your /tmp directory. You can then open a Python shell and print the statistics:

>>> import hotshot.stats
>>> stats = hotshot.stats.load("")
>>> stats.strip_dirs()
>>> stats.sort_stats('time', 'calls')
>>> stats.print_stats(20)

a 2nd option is perfmon which keeps track of performance data for individual requests and lets them be viewed via the django admin interface. This tool is free for people developing opensource projects.

Attachments (5)

Download all attachments as: .zip

Back to Top