[early access] Project Loom vs Kotlin Coroutines - Urs Peter @ Kotlin Dev Day Amsterdam 2021

Alan Bateman Alan.Bateman at oracle.com
Fri Dec 24 08:44:25 UTC 2021


On 23/12/2021 22:20, eric at kolotyluk.net wrote:
> One demo he ran seemed to suggest the Kotlin Coroutines were about 3 or 4
> times faster, possibly 3 or 4 times the throughput., so it will be
> interesting to see if Loom improves performance.

Thanks for the link. I assume the x3-4 is the example at around ~30mins 
which has one million threads calling Thread.sleep(2000). If that 
example is changed to have warm-up then the results will be very different.

> He also suggested that Kotlin Structured Concurrency was better than Loom,
> so it will also be interesting to see how that shakes out.
It looks like this talk was recorded before StructuredExecutor was in 
the EA builds, at least I couldn't find it in the presentation.

> He also pointed out where Loom is better than Kotlin, and that Kotlin
> Coroutines will be refactored after Loom is released.
>
I didn't hear it called out explicitly, but I think the most important 
difference is that Thread.currentThread() doesn't change in a thread of 
execution. Locks, thread-locals, and many other things are broken if the 
"current thread" is different after a blocking operation.

-Alan.


More information about the loom-dev mailing list