Changes between Version 15 and Version 16 of ProfilingDjango
- Timestamp:
- Apr 10, 2014, 6:25:37 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ProfilingDjango
v15 v16 3 3 == Profiling Specific Code == 4 4 5 Python has several profiling modules, the least worst of which is the apparently unmaintained [http://docs.python.org/library/hotshot.html hotshot]. It's better than the Profiler module for our purposes as it has simple 'start' and 'stop' methods, as well as a method that takes a callable and it 's arguments.5 Python has several profiling modules, the least worst of which is the apparently unmaintained [http://docs.python.org/library/hotshot.html hotshot]. It's better than the Profiler module for our purposes as it has simple 'start' and 'stop' methods, as well as a method that takes a callable and its arguments. 6 6 7 7 I wrap views and other callables I want to examine in a decorator like this one: … … 64 64 }}} 65 65 66 This willproduces files of the form `/path/to/logs/my_view-20100211T170321.prof`, so you can test your view under various input conditions and compare the results.66 This produces files of the form `/path/to/logs/my_view-20100211T170321.prof`, so you can test your view under various input conditions and compare the results. 67 67 68 68 To actually examine the results, you'll need to use the `hotshot.stats` module. A simple script like this: