24 ms·
This, one hundred percent. There's 3 tiers of things happening here. 1) Write Redis in C. Hard for some devs who only know Python, but good performance. 2) Wr
by sushshshsh 6y ago
This, one hundred percent. There's 3 tiers of things happening here.
1) Write Redis in C. Hard for some devs who only know Python, but good performance.
2) Write Redis in Python with C libraries. Doable for a Python dev, performance hit.
3) Write Redis in pure Python. A fun experiment to see the performance limitations of Python when compared to C running on the same machine.
- ZephyrBlu 6y agoThe thing is that the title/project makes you think it's 3), when it's actually 2). It feels a bit sensationalist to me, and I see this all the time with projects these days. It's kind of disappointing.
- UncleMeat 6y agoBut the claim is that he is dispelling common falsehoods. Are there actually people out there saying that python glue with c libraries for performance critical parts is going to be orders of magnitude slower than an entire thing written in c?
- sushshshsh 6y agoI actually don't like Python and much prefer Java, but I think #3 is really only for performance research and like, fun and games. It would be cool to have a quantified answer to "just how slow is Python"? I suspect the answer is many orders of magnitude slower. However, if the experiment in question is, "using python glue code, can a developer string together a service that replicates the functionality of redis", then that illustrates what would actually happen in the real world. For example, for a very junior Python developer, writing something in C is basically like asking a C developer to write assembly- possible, but they'd have to learn a lot of different things to do it. Similarly, when I write Java, I want to be calling Arrays.sort(myarray) instead of writing my own sort (if the focus is on developer convenience and development velocity). So, it's just a difference in what you're desiring to measure.