News for hackers. Stuff that matters.
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by albertzeyer on Monday June 06, 2022 @01:50PM (#31643498)
https://news.ycombinator.com/item?id=28880782 https://news.ycombinator.com/item?id=29005573 https://news.ycombinator.com/item?id=31348097

Note that Sam's no-GIL changes are not only about the removal of the GIL (although that was the main goal). There are a number of other unrelated improvements to make it faster. And as far as I know, most of those unrelated improvements have gotten into CPython now.

Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by rat87 on Monday June 06, 2022 @02:44PM (#31644129)
I'm worried about it. My understanding is that the GIL removal was still slower then with GIL, but that he added useful unrelated speedups to compensate. If the speedups get into 3.11 but no gil doesn't will they accept a significantly slower 3.12?
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by __d on Monday June 06, 2022 @08:12PM (#31648245)
Yeah, I'm worried too.

It seems like the core team doesn't share my sense that nogil is the single most important thing that Python needs to do in a world of many-core processors. If nogil is now blocked because it's deemed an unacceptable performance hit vs 3.11, I'll be very, very disappointed.

Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by O5vYtytb on Monday June 06, 2022 @11:04PM (#31649416)
Most python code in the world is currently single threaded. It makes sense to me to start with the low hanging fruit that affects the majority of existing code and then move on to harder problems.
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by __d on Tuesday June 07, 2022 @05:55AM (#31651954)
Sure, but Guido put a pre-condition on GIL removal years ago that it must not cause single-threaded code to suffer a performance penalty.

So Sam came up with a way to ensure that (on balance, if not in every example), we could have same-or-better performance and no GIL. Awesome!

But now we're getting the performance boosts without the GIL removal, and so in the next release, the GIL removal will cause a performance regression unless we can somehow find more performance boosts. It feels like this could just happen forever.

Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by O5vYtytb on Wednesday June 08, 2022 @09:36AM (#31667116)
There's many more improvements to be made in single threaded performance, including things like JIT. Future improvements are complicated, they won't be a free lunch like this first round has generally been. My feeling is that things like JIT and nogil will start out as optional and work their way into the ecosystem over time where the performance implications are less severe for the general use case.
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by zackees on Tuesday June 07, 2022 @01:13AM (#31650127)
Why? Python gives you the ability to spawn processes so there's always an escape hatch for building multi-core code.
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by __d on Tuesday June 07, 2022 @05:51AM (#31651923)
Right. But as you implicitly note, it's a work-around ("escape hatch"), not a feature.

eg. Unix had processes from day 1, but threads were added (with significant effort) because threads are a better abstraction for addressing lot of problems. Especially so when your CPU has lots of cores.

The work to make multiprocessing better is certainly useful, and valuable, but it's still a work-around.

Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by jacob019 on Monday June 06, 2022 @03:45PM (#31645159)
It might make sense to have runtime configuration that enables no-GIL mode, or just enable it automatically when importing threading, so that non-threaded workloads don't suffer.
Re:Python 3.11 Performance Benchmarks Are Looking Fantastic by O5vYtytb on Monday June 06, 2022 @11:03PM (#31649403)
The faster cpython project isn't done after 3.11. they're working on many other improvements for 3.12 and we'll see other things possibly a JIT or at least an API to facilitate accelerators in 3.13+

I'm not worried about a lack of single thread performance increases for some time.