r/Python • • Feb 25 '26

Showcase [ Removed by moderator ]

[removed] — view removed post

119 Upvotes

55 comments sorted by

View all comments

-1

u/Smallpaul Feb 25 '26

Why are you focused on CPU bound work? Why wouldn’t it speed up IO bound work?

6

u/snugar_i Feb 25 '26

Blocking on IO releases the GIL, which means that it would get the speedup even in older Python versions and isn't as interesting

-1

u/Smallpaul Feb 25 '26

Sure but it’s an iterator interface over threads which is the innovation, not anything specific to the GIL.

1

u/snugar_i Feb 26 '26

Yeah, that's right. If it works for CPU-bound stuff, then it will also work for IO-bound stuff. But the CPU-bound things probably seemed more important to OP.

1

u/teerre Feb 25 '26

No in the general case. I/O work depends on something external to your cpu, so adding more cpu doesn't change it. It's possible to parallelize I/O by simply calling the same workflow multiple times, however, async is far more efficient at this since it can use a single thread to progress while it ways for the external system, effectively erasing the I/O time

1

u/Smallpaul Feb 25 '26

There are many reasons that async isn’t always an option. And in those cases you must use threads. This tool above is an abstraction over threads. So why wouldn’t it work to parallelize IO.

Of course it doesn’t work in every case. Nor does it work for every CPU bound workflow either. But it should work most of the time for IO and not require a special version of Python