News for hackers. Stuff that matters.
Re:Faster CPython at PyCon, part one by piyh on Thursday May 11, 2023 @02:11PM (#35905974)
Python can use multiprocessing with a shared nothing architecture to use those 32 threads.
Re:Faster CPython at PyCon, part one by malodyets on Thursday May 11, 2023 @03:06PM (#35906846)
I was about to say the same thing.

Multiprocessing on Python works great and isn’t even very hard if you use say async_apply with a Pool.

Comparing single-threaded Python with multiprocesssing in Language X is unfair if not disingenuous.

Re:Faster CPython at PyCon, part one by mlyle on Thursday May 11, 2023 @04:58PM (#35908297)
> Multiprocessing on Python works great and isn’t even very hard if you use say async_apply with a Pool.

Multiprocessing works great if you don't really need a shared memory space for your task. If it's very loosely coupled, that's fine.

But if you use something that can benefit from real threading, Python clamps you to about 1.5-2.5 cores worth of throughput very often.

Re:Faster CPython at PyCon, part one by heavyset_go on Thursday May 11, 2023 @05:05PM (#35908383)
There's a serialization overhead both on dispatch and return that makes multiprocessing in Python unsuitable for some problems that would otherwise be solved well with threads in other languages.
Re:Faster CPython at PyCon, part one by mirekrusin on Thursday May 11, 2023 @11:27PM (#35911524)
Unless you don't need to change your code.
Re:Faster CPython at PyCon, part one by bombolo on Thursday May 11, 2023 @03:26PM (#35907177)
Hear me out… we can write bad python code to justify impressive speed boosts rewriting it in rust.

In this way we can justify rewriting stuff in rust to our bosses!

If we write decent python, and perhaps even replace 1 line to use pypy, the speedup won't be impressive and we won't get to play with rust!

Re:Faster CPython at PyCon, part one by vlovich123 on Thursday May 11, 2023 @05:02PM (#35908344)
The other languages are not taking/releasing a globally mutually exclusive GIL every time it crosses an API boundary and thus "shared nothing" in those languages is truly shared nothing. Additionally, Python's multiprocessing carries a lot of restrictions which makes it hard to pass more complex messages.
Re:Faster CPython at PyCon, part one by coldtea on Thursday May 11, 2023 @06:39PM (#35909305)
And each of these threads will still have the Python interpreter performance.

Nothing preventing something like Mojo to also use those same 32 threads but with 10-100x the performance instead.