Skip to content

Commit 98f9601

Browse files
committed
Document performance implications.
Fix #78.
1 parent 561d84d commit 98f9601

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

docs/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ The debug toolbar has two settings that can be set in ``settings.py``.
103103
'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
104104
'HIDE_DJANGO_SQL': False,
105105
'TAG': 'div',
106-
'ENABLE_STACKTRACES' : True,
106+
'ENABLE_STACKTRACES': True,
107107
'HIDDEN_STACKTRACE_MODULES': ('gunicorn', 'newrelic'),
108108
}

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Django Debug Toolbar
66

77
installation
88
configuration
9+
tips
910
panels
1011
commands
1112
contributing

docs/tips.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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

Comments
 (0)