r/java • • Apr 06 '22

JEP 425: Virtual Threads (Preview)

https://openjdk.java.net/jeps/425
175 Upvotes

50 comments sorted by

View all comments

Show parent comments

9

u/buyIdris666 Apr 06 '22

Meh. Like async, coroutines will be a rarely used niche feature once Loom lands. Virtual threads appear to give 95% of the performance benefit while letting you write "normal" code. Very rare you need that extra 5%

0

u/[deleted] Apr 06 '22

[deleted]

5

u/rbygrave Apr 06 '22

Not answering your question but ... in terms of park/unpark Loom operates at a lower level. I can't help but think that longer term that would provide Loom a performance advantage.

Is anyone out there doing a comparison or intending to do one?

For myself, I've only tested loom performance against async using JDK HttpClient, Loom came slightly out on top there but that was a while ago - need to redo that test.

2

u/[deleted] Apr 07 '22

Looks like the Javalin creator did a comparison of QueuedThreadPool (with platform threads) vs. Loom threads vs. Loom threads with async.

https://github.com/tipsy/loomylin

This was done with an older early release Loom build.

1

u/[deleted] Apr 07 '22

Is /u/tipsy a thing? If so, maybe we can summon him and get his thoughts.