Live data from Hacker News

Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

github.com

1–10 of 192 posts

Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

#4

This is a python wrapper around libuv not a pure python solution (not that it’s bad but it explains the click bait title).

Would a framework like uvicorn/fastapi be able to achieve similar performance if it were backed by libuv (as opposed to e.g. asyncio)?

Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

#5
post #3

Probably should add that it's faster with PyPy as it might not be obvious on how an interpreted language like Python can beat an AOT compiled language like Go. Interesting results nevertheless.

Yeah, I'm converting to HPy and it probably will be faster in CPython too, but like you said AOT is hard to beet without JIT at least. But with CPython is faster than Golang Gin :D

Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

#6
post #4

This is a python wrapper around libuv not a pure python solution (not that it’s bad but it explains the click bait title).

Would a framework like uvicorn/fastapi be able to achieve similar performance if it were backed by libuv (as opposed to e.g. asyncio)?

uvicorn and fastapi is backed by libuv :) it uses uvloop

Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

#7

This is a python wrapper around libuv not a pure python solution (not that it’s bad but it explains the click bait title).

uvicorn uses uvloop that is an wrapper to libuv ;) almost any performance focused package use native extensions (CFFI, Cython, HPy, Python CAPI etc)

Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3

#9
post #4

This is a python wrapper around libuv not a pure python solution (not that it’s bad but it explains the click bait title).

Would a framework like uvicorn/fastapi be able to achieve similar performance if it were backed by libuv (as opposed to e.g. asyncio)?

Pydantic is unreasonably slow for big datastructures, though. For simple performance tests with simple requests/response it's probably fast. But with lots of the data marshalling happening in python some things are really slow in real life use cases.
Post reply on HN