47 points · by yumaikas · 7y ago · 27 comments
Perhaps it was my wording that caused this confusion, for which I am sorry, but I never meant to compare "pure" Python with C. The point I am trying to make is that, Python with C extensions can be as considerably[1] performant as C code for network or memory bound tasks.
[0]: https://www.reddit.com/r/Python/comments/awav6k/pydis_a_redi...
[1]: It's of course controversial whether 60% throughput is considerable or not.
But personally, I don't see how the usage of hiredis is so much different from literally taking a part of Redis itself and embedding it in Python. As a thought experiment, if I did take Redis's parsing code and embed it in Python, would it still be fair?
I'm not really convinced that a pure Python implementation of the Redis Serialization Protocol would actually be meaningfully slower than the Python bindings to hiredis, so this whole thing may be a bit moot.
I think your project is cool. Perhaps some changes to the README to explain exactly what your benchmarks are meant to show about Python itself would help the criticism.
I agree. I'll edit when I have some time this week. =)
> Unfortunately many programmers, due to their lack of experience, of some knowledge of computer architecture(s), or of an in-depth understanding of the task they are given
Where you fail to see that C libs being linked into python code is the same as python code performance
It's strongly typed and mypy adds static typing support too (so you end up with a strong gradually typed language). Would you consider it insufficient?
I'd like to see the same thing in a few different languages, just for fun - perhaps a Perl or Rust redis, for example.
Since we're sharing Redis clones, here's my multithreaded one: https://github.com/JohnSully/KeyDB
This takes advantage of probably the two highest performing aspects of Python: raw dict and async (especially under uvloop).
If your app does mostly those things, then yes, Python is a good choice. It doesn’t say much about anything else.
From my limited understanding of Python, it compiles into bytecode that is fed into a virtual machine doesn't it? How can that ever be just as fast as C? Unless the C programmer does a really bad job?
You might want to check the r/Python thread as well: https://www.reddit.com/r/Python/comments/awav6k/pydis_a_redi...
When I have some time, I'd love to port those two to pypy and see how it performs (but porting uvloop would be task on its own!)
That sounds like the definition of confirmation bias.
How is that substantiated?