A good example of why web servers should be measured in seconds per request rather than requests per second. As you trim little tiny bits off the seconds per request, the requests per second go skyrocketing off to infinity, but unless you're doing zero work per request, that's a dubiously useful metric. 1,000,000 requests per second on what I think is an 8-core system (?) is 1/1,000,000 * 8 = 8us per request. 1,250,0…
Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
171–180 of 192 posts
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#172Earlier quoted context omitted.
I don't really understand this criticism nor why it's "clickbait". I have 12 "unpure" python packages in production. If my app ever needs WSGI, I'll have 13.
The reason this is clickbait is because you can wrap libuv in some other language and get the same results. So what’s the purpose of this article? That a language can wrap libuv is not a new or interesting idea.
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#173Earlier quoted context omitted.
Python GIL is the problem for multithreading, but I think I have a solution to not need 8 DB pools, soon o will post about it. But yeah it's a waste
Oh, I have a pretty fresh news for you. https://github.com/python/peps/pull/2955
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#174Good point! However, you bring in a common misconception I'm fighting with within my company for a long time. Python is not an interpreted language. There is no such thing as an "interpreted language", a language is just a set or rules and keywords. Everything you can fit into Backus–Naur form is already a language even if it doesn't have any implementation nor compiler neither interpreter. Just as a piece of evidenc…
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#175Earlier quoted context omitted.
I'm so happy this is (currently) the top comment and people are starting to realize measuring perf with these well tuned micro-benchmarks is a sham.
Why is it a sham? It's useful to know that x is faster. As a user of x I don't really care if the reason it's faster is it's C++ under the hood. That's really an implementation detail for me.
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#176I don't quite understand the corking documentation. Is this like TCP_CORK? A buffered/batch send? Can anyone point me to details? https://docs.socketify.dev/corking.html https://baus.net/on-tcp_cork/
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#177Good point! However, you bring in a common misconception I'm fighting with within my company for a long time. Python is not an interpreted language. There is no such thing as an "interpreted language", a language is just a set or rules and keywords. Everything you can fit into Backus–Naur form is already a language even if it doesn't have any implementation nor compiler neither interpreter. Just as a piece of evidenc…
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#178Earlier quoted context omitted.
The perf part of the tests just seems to be a microbenchmark for seeing how fast the various frameworks can parse a 30000x300 dict of strings representing numbers [1]. If that is all one's application does, and can use your library in their organization/team, that's great. However a 2-3x performance boost for the parsing stage for a use case like an API call might not matter when that could be overshadowed by validat…
> a microbenchmark for seeing how fast the various frameworks can parse a 30000x300 dict of strings representing numbers [1]. Did you somehow miss all the other tests, even thought they are higher on the page? The important test is shown first: loading objects. I'm not trying to benchmark my wifi or my disk. The IO time is not included there on purpose. Of course a bigger application that does other things wouldn't s…
Not a Python expert, but could the Pydantic tests be possibly not realistic and/or misleading because they are using kwargs in __init__ [1] to parse the object instead of calling the parse_obj class method [2]? According to some PEPs [3], isn't Python creating a new dictionary for that parameter which would be included in the timing? That would be unfortunate if that accounted for the difference.
Something else I think about is if a performance test doesn't produce a side effect that is checked, a smart compiler or runtime could optimize the whole benchmark away. Or too easy for the CPU to do branch prediction, etc. I think I recall that happening to me in Java in the past, but probably not happened here in Python.
[1] https://github.com/ltworf/typedload/blob/37c72837e0a8fd5f350...
[2] https://docs.pydantic.dev/usage/models/#helper-functions
Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#179Re: Show HN: Socketify.py: Http/Https and WebSockets servers for PyPy3 and Python3
#180Earlier quoted context omitted.
Last I checked, Pypy wasn’t compatible with many important packages in the Python ecosystem. As of a couple years ago, there was no trustworthy, supported package for talking to a Postgres database with Pypy because psycopg2 wasn’t supported.
I've been using PyPy and psycopg2cffi in production for the last 5-6 years or so without any issues. https://pypi.org/project/psycopg2cffi/