ASGI, SSGI, Falcon and Socketify.py #2135
cirospaciari
started this conversation in
Ideas
Replies: 1 comment
-
Updated TechEmPower using plaintext to see the overhead of Falcon and ASGI/WSGi it self over socketify.py
Updated websockets benchmark (the same used by bun.sh)
With pub/sub versions using PyPy and Python3 performs the same because of C++ optimizations and low overhead, so when using socketify.py/socketify.py-asgi or falcon+socketify.py-asgi the results will be the same so was omitted. Without pub/sub 80~100k req/s of performance hit. Source for Falcon with pub/sub support and enable_buffered_receiver option here: https://github.com/cirospaciari/falcon/tree/master |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@vytas7 days ago (or week almost an month), said that will be really great if socketify.py could power Falcon, i promise some preliminary version until end of the month (november).
I just implemented an pure python wrapper (not the best choice for performance but is the start) to see if i can give more performance in WebSockets
This is the results before a lot of things are fixed on socketify.py, now it can reach over 1.2 million message per second.
I added in https://github.com/cirospaciari/falcon an extension for websockets and ASGI, to add pub/sub to Falcon. The results are really good! With pub/sub we can reach 200k messages per second now with falcon, and without pub/sub we can reach 100k messages per second.
Here is an sample code for subscribe/subscribe and publish with falcon using topics.
I will compare it with Django channels soon.
ASGI added a lot of overhead to socketify.py for HTTP and WebSockets, but pub/sub do most of the work inside native world that's why is so fast. I will write an spec called SSGI (Socketify Server Gateway Interface) to power Websockets and HTTP, will accept async and sync code (mixed) you can use whatever you want, when you need to give the best performance out of it. And to remove more overhead of course, i will use ASGI falcon implementation as base and test case.
I will create an new branch, and will update this discussion and gitter, if you have any ideas or comments please let me know, i will open an PR to Falcon with pub/sub extension after documenting ASGI in socketify.py.
Beta Was this translation helpful? Give feedback.
All reactions