Halina
07/22/2025, 10:58 AMArjan van Wieringen
07/22/2025, 3:06 PMmarcinmoskala
07/22/2025, 3:43 PMKirill Grouchnikov
07/22/2025, 5:25 PM<http://Dispatchers.IO|Dispatchers.IO>.limitedParallelism(n)
is the best answer?marcinmoskala
07/22/2025, 7:25 PMArjan van Wieringen
07/23/2025, 5:39 AMmarcinmoskala
07/23/2025, 8:01 AMArjan van Wieringen
07/23/2025, 8:59 AMmarcinmoskala
07/23/2025, 9:44 AMWout Werkman
07/29/2025, 8:00 AMrunInterruptible {}
, and I've been waiting for a long time for someone to post an article about whether runInterruptible
is more efficient on virtual threads because I've been procrastinating investigating it myself :p
Naively I'd expect runInterruptible
to be orders of magnitude more efficient on virtual threads, and it should be a no-brainer to wrap all blocking IO calls in a virtual thread dispatcher + runInterruptible
. But my rudimentary benchmark doesn't show as much of a performance improvement as I expected.
(I've attached my benchmark result of cancelling a bunch of runInterruptible
coroutines using <http://Dispathers.IO|Dispathers.IO>
and a virtual thread dispatcher, but please take it with a bucket of salt! This is NOT a proper benchmark)