News for hackers. Stuff that matters.
Re:Pydis – Redis clone in 250 lines of Python, for performan... by tutfbhuf on Sunday November 15, 2020 @09:21AM (#25101372)
From your README.md:

> pydis is an experiment to disprove some of the falsehoods about performance

and your comment:

> The point I am trying to make is that, Python with C extensions can be as considerably performant as C code for network or memory bound tasks.

So your point is regarding the falsehood belief that python with heavy use of C extensions is (not) much slower (in this case ~60%) than C? I don't think that such a falsehood belief exists and therefore pydis disproves nothing.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by jnwatson on Sunday November 15, 2020 @12:09PM (#25102682)
You're missing the point. Obviously, you can write your application in Cython and have decent performance.

The entire purpose is to demonstrate that you can build a reasonable performance application built on high performance libraries and stick with idiomatic Python code.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by sushshshsh on Sunday November 15, 2020 @12:27PM (#25102871)
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.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by ZephyrBlu on Sunday November 15, 2020 @01:51PM (#25103624)
The 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.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by UncleMeat on Sunday November 15, 2020 @04:28PM (#25105056)
But 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?
Re:Pydis – Redis clone in 250 lines of Python, for performan... by sushshshsh on Sunday November 15, 2020 @05:18PM (#25105465)
I 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.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by rualca on Tuesday November 17, 2020 @12:03AM (#25120430)
> You're missing the point. Obviously, you can write your application in Cython and have decent performance.

"Decent" is a weasel word, which suggests that the performance hit of following this approach is tolerable or acceptable. Sometimes it is, sometimes it isn't. It really depends on where you place the glue code, and where you expect the hot path to be.

In the case of a self-described "Redis clone" which ends up being Redis itself glued back together with Python, I'm not sure you can make that case.

> The entire purpose is to demonstrate that you can build a reasonable performance application built on high performance libraries and stick with idiomatic Python code.

I'm sorry to say but that isn't much of a demonstration. I mean, Python is already widely used as glue code to hold together high performance libraries, and it's already widely known and understood that gluing together code with Python brings in a significant performance hit. And that's ok, because people do it as a tradeoff between performance and some other kind of value-added.

But in this case I fail to see what value-added is being proposed, other than the personal portfolio side of things.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by tutfbhuf on Sunday November 15, 2020 @01:44PM (#25103560)
> You're missing the point.

Well, your claim is that the author has missed the point, because I just quoted the authors point and his intended purpose. So I guess we both agree.

Re:Pydis – Redis clone in 250 lines of Python, for performan... by mekoka on Sunday November 15, 2020 @02:56PM (#25104213)
> I don't think that such a falsehood belief exists and therefore pydis disproves nothing.

You don't think such a falsehood belief exists, therefore you don't think pydis disproves anything.