Hot take: FastAPI isn't always faster than Django. I spent last week load testing our Django and FastAPI services side-by-side. The results surprised me: Database-heavy operations: - Django: 180ms avg response - FastAPI: 175ms avg response - Difference: ~3% CPU-bound operations: - Django: 420ms avg response - FastAPI: 145ms avg response - Difference: 65% faster Why? Most "slow" backends are bottlenecked by I/O, not Python's GIL. The real performance wins? 1. Connection pooling (asyncpg vs psycopg2) 2. Query optimization (N+1 fixes, indexes) 3. Caching (Redis, in-memory) 4. Proper async/await (not blocking the event loop) Framework choice matters less than you think for CRUD APIs. Choose Django for: batteries-included, admin panel, ORM maturity Choose FastAPI for: async-first, OpenAPI docs, type safety Both are production-ready. Optimize your queries first. Day 1 of sharing real backend engineering insights. What's your experience? Django, FastAPI, or both? #Python #Django #FastAPI #BackendDevelopment #PerformanceOptimization
My own web framework (WebCore) excluding the "extras" (such as ORM, which isn't web, or task pooling, which isn't web, &c.) is capable of exhausting available port allocation in less than two seconds indicating that HTTP and TCP aren't the true bottlenecks. My framework also has no particular opinion on other stack components; pick your own ORM/ODM, template engine, whatever. Template rendering is also modular (web.template entry_points registry) and I do offer one of my own (cinje, supporting streaming generation) which for some reason is also an order of magnitude (or three) faster than seems typical. My preference is… neither? Modular v. monolithic. (Django has just really never offered the performance I find reasonable, and I have used it on team-driven commercial solutions in the past.)
Optimizing what we already have ✌🏽 everything comes down to how we handle I/O and queries
You failed to explain your own "Hot-Take"! And ended up explaining "How to improve your application performance". People can Google
This query is relatively expensive because it retrieves full model instances. It should be optimized to load only the required fields. Instead of fetching entire User objects, use: User.objects.values('id', 'username', 'email') This approach is more efficient because it: • Selects only the required columns at the SQL level • Avoids constructing full model instances • Reduces memory usage and serialization overhead For read-heavy operations such as APIs, values() or values_list() is typically the most performant option in django.