|
| 1 | +Tips |
| 2 | +==== |
| 3 | + |
| 4 | +Performance considerations |
| 5 | +-------------------------- |
| 6 | + |
| 7 | +The Debug Toolbar adds some overhead to the rendering of each page. Depending |
| 8 | +on your project, this overhead may slow down page loads significantly. If that |
| 9 | +makes development impractical, you can tune some settings to disable the most |
| 10 | +expensive features and restore decent response times. |
| 11 | + |
| 12 | +The SQL panel may be the culprit if your view performs many SQL queries. You |
| 13 | +should attempt to minimize the number of SQL queries, but this isn't always |
| 14 | +possible, for instance if you're using a CMS and have turned off caching for |
| 15 | +development. In that case, setting ``ENABLE_STACKTRACES`` to ``False`` in the |
| 16 | +``DEBUG_TOOLBAR_CONFIG`` setting will help. |
| 17 | + |
| 18 | +The cache panel is very similar to the SQL panel, except it isn't always a bad |
| 19 | +practice to make many cache queries in a view. Setting ``ENABLE_STACKTRACES`` |
| 20 | +to ``False`` will help there too. |
| 21 | + |
| 22 | +The template panel may be slow if your views or context processors return |
| 23 | +large contexts and your templates have complex inheritance or inclusion |
| 24 | +schemes. In that case, you should set ``SHOW_TEMPLATE_CONTEXT`` to ``False`` |
| 25 | +in the ``DEBUG_TOOLBAR_CONFIG`` setting. |
| 26 | + |
| 27 | +Finally, if you don't need the panels that are slowing down your application, |
| 28 | +you can customize the ``DEBUG_TOOLBAR_PANELS`` setting to include only the |
| 29 | +panels you actually use. |
0 commit comments