Green Coding with Django
summary
Green Coding focuses on measurable wins: clearing background tabs to avoid CPU/RAM/swap waste, and addressing app-level inefficiencies where most energy goes. Profiling with cProfile, Django Debug Toolbar, Silk or perf and monitoring with Datadog/Sentry finds hotspots. A concrete case: 5,000 questions with 5 choices (25k rows) runs ~50s and ~5,000 queries without prefetch_related and ~1s with 2 queries using prefetch_related; use bulk_create for inserts (drops tens of seconds to <2s) and optimise DB indexes and caching.
AI-written summary · about
chapters (6)
- 0:00Introduction to green coding
- 2:02Behavioral considerations
- 5:43Hardware and efficiency
- 11:17Personal habits and energy
- 16:40Structural code efficiency
- 21:55Code optimization techniques
related talks
37mPerformant Django
28mThe life of a web request - techniques for measuring and improving Django application performance
25mFaster, leaner, greener: 10x lower website carbon emissions with Thibaud Colas
47mReal World Django Q&A
31mHigh Performance Django
17mOff the Beaten Path: Exploring Unusual Roads to Django Performance
42mA Nice Problem to Have: Django Under Heavy Load
44mDebugging Performance
