I wonder about the end-result payoff of this approach. In general, 
Django/Python code is not going to be I/O bound, which is where 
asynchronous approaches are going to get the bang for your buck. Even when 
it comes to DB access—the DB is a lot faster than the python and django 
code running against the result set. And too much context-switching (as you 
noted) has painful ramifications for performance.

I can absolutely see why creating a layer that handles asgi, websockets, 
and http requests asynchronously is going to pay off. Bit time. But I'm 
less certain that the ORM access will benefit from an asyncio approach. Do 
we have anything that approaches a hard number that would tell us re-doing 
the ORM layer in asyncio would get us X% performance benefit?

I'm basing my thoughts off this well-reasoned look at performance: 
https://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/

On Thursday, May 9, 2019 at 12:11:19 PM UTC-4, Andrew Godwin wrote:
>
> Hello everyone,
>
> While the ASGI patch (https://github.com/django/django/pull/11209) is 
> maybe the first small step in a long road to async, it's the only real one 
> we could do without a DEP as it purely pulls on existing specs and bugs.
>
> To that end, I have drafted a DEP (provisionally #0009), "Async-capable 
> Django". It is a summary - and I use that word very lightly - of the rest 
> of the work to be done to make a version of Django that one could call 
> "async capable".
>
> You can view it here: 
> https://github.com/andrewgodwin/deps/blob/async/draft/0009-async.rst
>
> It is approximately 7,000 words long - while it could probably do with 
> some editing, the subject matter means it has to be quite in-depth. Even 
> then, it does not propose an exact plan to follow; instead, it proposes the 
> overall strategy and the high-level ideas about what needs to be done.
>
> If you are short on time, please read the Foreword and the High-Level 
> Summary, and then jump around using the table of contents to the sections 
> that interest you.
>
> Feedback on this is very much appreciated; you can either reply here or, 
> if you have comments that would benefit from precise location on the diff, 
> use the pull request here: https://github.com/django/deps/pull/56
>
> This is a very complex topic, and I appreciate feedback might take a 
> while; at least a couple of weeks to get everyone's thoughts. If you want a 
> more private channel to discuss concerns or design questions you're not 
> happy to talk about publicly, feel free to email me directly.
>
> This proposal does not quite fit the DEP template - we never really 
> planned for something of this scale - but I have done my best to make it 
> work; I think we still benefit from discussing and voting on it in the DEP 
> format, but suggestions on how to make it work better are welcome, provided 
> they fit within how Django operates as a community now.
>
> Finally, if there is positive feedback on this, we have the separate 
> question of funding it that I will discuss separately, if and when we get 
> that far. The DEP covers some of the topics, but it's notable that the 
> implementation speed of this varies considerably; if we could get, say, me 
> and someone else on it full-time (which is not a cheap or likely prospect), 
> we can probably be done inside of a single release. If we rely just on 
> volunteer time, it may take years. There is hopefully somewhere between 
> those two that works.
>
> Thanks for taking the time to read through!
>
> Andrew
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a51fac9e-5632-432c-adb1-74e9335c8264%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to