~/talk

Sync vs. Async in Python: Tools, Benchmarks, and ASGI/WSGI Explained

Talkat PyCon US 2024 · 2024-05-15..05-23· [python, web-platform]
links:none on file
slides:none on file

Claims concrete numbers and tools: synchronous WSGI test tops at ~100 users and ~1.6 RPS while ASGI tests hit thousands of concurrent clients with about 13,335 RPS, using uvicorn workers and uvloop event loop; benchmarks use Locust and highlight unexpected dips when any blocking library or heavy thread pools remain. Migration checklist is specific: make all code nonblocking, replace sync libraries or wrap them with asgiref shims, prefer native async drivers like asyncpg, and profile with py-spy or cProfile.

AI-written summary · about

  1. 0:00Sync vs async in Python
  2. 2:56Sync vs async basics
  3. 6:52Event loops for async tasks
  4. 8:20WSGI and limitations
  5. 10:07ASGI: The async server gateway interface
  6. 12:36ASGI vs WSGI for I/O
  7. 15:25Migrating to async apps
  8. 18:59Benchmarking async performance
  9. 23:43Benchmark results analysis
  10. 25:49Async-compatible libraries
  11. 26:51Q&A: Thread pools
  12. 28:36Q&A: Docker memory issues
  13. 30:25Q&A: ChatGPT-like ASGI
~/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.