-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This function is called by the SQL panel to render each frame of each stack trace. Previously it used a Django template, which is slow. By generating the HTML with pure Python code, we can avoid much of this overhead. I tried this change on a demo app I built that has 96 total queries, due to N+1 queries. The queries execute in 13ms due to use of SQLite, so the whole view is a negligible concern. Nearly all the view runtime is the toolbar itself. Without this change, the runtime is ~1300ms; with the change it’s ~1100ms. That's a saving of **15%**. I also checked the appearance of the generated HTML hasn’t changed.
- Loading branch information
1 parent
46b661f
commit 4289268
Showing
2 changed files
with
26 additions
and
25 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
debug_toolbar/templates/debug_toolbar/panels/sql_stacktrace.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters