~/talk

Optimizing your webapp by using django-debug-toolbar

Talkat DjangoCon US 2014 · 2014-08-30..09-06· [django, testing]
slides:none on file

Page-level SQL inspection with django-debug-toolbar reveals the list view issues: 52 queries for a simple page and 44 for a detail page. Rewriting queries with select_related collapses repeated foreign-key fetches down to 2 SQL statements; using prefetch_related pulls many-to-many and reverse-FK sets in separate batched queries and drops the detail view to 7 queries. The demo shows concrete line-level query locations, simple view changes, and large, measurable speed gains.

AI-written summary · about

  1. 0:00Start
  2. 0:06Diamond Sponsor
  3. 0:22Christopher Adams
  4. 2:06Manage your own expectations for tools
  5. 2:41Unicorns don't exist
  6. 3:26Abstraction layers
  7. 6:57Hits the database (QuerySet is "evaluated")
  8. 8:25Models
  9. 9:24List View
  10. 9:38List Template
  11. 10:10Detail View
  12. 10:33Detail Template
  13. 16:26select_related
  14. 19:24prefetch_related
  15. 21:36Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.