Login

Tag "profiler"

Snippet List

Profiling Middleware w/sorting

Based *very heavily* on the middleware in [this snippet](http://www.djangosnippets.org/snippets/727/). As with that one, append '?prof' to the URL to see profiling output instead of page output. The big change is that you can also pass an argument to control sorting. For example, you can append '?prof=cumulative' to sort the results by the cumulative time consumed. See the [documentation on the Stats class](http://docs.python.org/library/profile.html#pstats.Stats.sort_stats) for all the options.

  • middleware
  • performance
  • profiler
Read More

Profiling middleware using cProfile

Similar to [Profiling Middleware](http://www.djangosnippets.org/snippets/186/), but uses cProfile instead of hotshot. Append ?prof to the URL to see profiling output instead of page output.

  • middleware
  • performance
  • profiler
Read More
Author: sgb
  • 5
  • 24

2 snippets posted so far.