~/talk

Performant Django

Talkat DjangoCon US 2014 · 2014-08-30..09-06· [web-performance, python]
speakerdeck:ara818
slides:none on file

Front-end work takes 80–90% of user response time so start by caching static assets forever (Django’s cacheable static file storage), bundling/minifying with django-pipeline or webassets, and serving via CDN from S3 with django-storages — doing so cuts hundreds of milliseconds on real endpoints. Back end uses profiling (django-debug-toolbar, dev server) to find SQL hot spots and Python hotspots; use select_related/prefetch_related, only/defer, bulk_create, denormalize, or targeted function-level caching (worked via a tiny cache-helper) to remove surprising costs like 50,000 reverse calls or a decimal constant costing ~0.25s.

AI-written summary · about

  1. 0:00Intro
  2. 1:13But first, a quick note about frontend performance
  3. 2:02Front-End Performance Work
  4. 3:11Best Practice: Cache static assets forever (as long as they don't change)
  5. 4:40Best practice: Bundle/minity/ compress static assets
  6. 7:39Best Practice: Serve static files via a CDN.
  7. 8:40Best Practice: Serve more stuff as static assets.
  8. 10:24Back-End Performance Work
  9. 13:42Backend performance work starts with a profile of the "problem" view Use a profiler middleware!
  10. 14:31What does a profile look like?
  11. 15:45Understanding a profile
  12. 16:27What if the problem is SQL?
  13. 17:59SQL Tricks, Part 2
  14. 24:43What if the problem is SQL and none of the above helps?
  15. 26:18What if the problem is in the Python?
  16. 28:29Example 2
  17. 32:56Many types of caching
~/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.