#37165 closed Cleanup/optimization (fixed)
Update Async Topic Docs
| Reported by: | Carlton Gibson | Owned by: | Carlton Gibson |
|---|---|---|---|
| Component: | Documentation | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The Asynchronous support topic doc was written when we first introduced async support. It's outdated, and the warnings it gives are misleadingly negative. Time to refresh it.
The main problems are:
- It strongly implies that Django's asynchronous story is unfinished. It's often linked to in blog posts. And it's totally misleading. The user API is essentially finished. From the PR: """Many parts of Django provide asynchronous APIs, including :ref:
the ORM <async-queries>, the cache framework, authentication, sessions, mail, and signals. For other code, the :func:sync_to_asyncadapter is a low-cost bridge (see :ref:async_performance)."""
- The performance warnings are severely outdated.
sync_to_async/async_to_syncusage is in the order or microseconds with modern versions of Python. This plays directly into implementation considerations where we're constantly pulled towards duplicating whole code trees, on the mistaken assumption thatsync_to_asyncusage (in particular) incurs a (relatively) massive performance hit.
- It makes no mention of the remaining async difficulties — such as concurrent DB queries — which are not Django specific. In particular connection pooling is the appropriate lever to increase throughput, regardless of whether you're using Django, any other async orm, or raw connections by hand. (The current phrasing implies it's the ORM that's at fault here: it's not!)
The topic doc here is a big source of the negative narrative about Django's async story. It's time to correct that.
Change History (10)
comment:1 by , 3 weeks ago
| Has patch: | set |
|---|
comment:2 by , 3 weeks ago
| Description: | modified (diff) |
|---|
comment:3 by , 3 weeks ago
| Description: | modified (diff) |
|---|
comment:4 by , 3 weeks ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:5 by , 2 weeks ago
FWIW this has come up again today on comments on ann interview of Jeff’s from PyCon US. “when will the ORM be async?”
Version 0, edited 2 weeks ago by (next)
comment:7 by , 13 days ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
PR