r/Python • • Feb 25 '26

Showcase [ Removed by moderator ]

[removed] — view removed post

119 Upvotes

55 comments sorted by

View all comments

16

u/NoLime5219 Feb 25 '26

This is exactly the kind of interface Python 3.14t needed. The fact that you're getting 5.6x on 10 cores for simple sum workloads is really strong — that's approaching linear scaling. One thing I'd be curious about: how does it handle workloads where individual iterations have highly variable costs? Like if you're processing a mix of small and large JSON blobs, does the divide-and-conquer work stealing keep cores balanced, or do you end up with stragglers? Also, have you compared memory overhead against multiprocessing for realistic dataset sizes? The shared memory advantage is clear on paper, but I'm wondering about real-world impact when you're not just summing integers. Either way, this feels like the right API design — Rayon proved chainable parallel iterators work brilliantly in Rust, and bringing that to Python without GIL overhead is huge.

15

u/fexx3l Feb 25 '26

Thanks! On variable-cost workloads, honest answer is the current implementation uses static divide-and-conquer, meaning splits happen upfront by index, not dynamically based on actual work. So yes, you can get stragglers if costs vary significantly across the dataset. True work stealing like Rayon’s is on the roadmap but not there yet.

On memory overhead vs multiprocessing: I don’t have solid benchmarks for that beyond the theoretical advantage of shared memory. It’s on my list to measure properly with realistic datasets. If you have a workload you’d like to test against, happy to run it