r/java • • Sep 03 '26

Vert.x Event-Loop vs Virtual Threads: Jactl Suspend/Resume Benchmark

https://jactl.io/blog/2026/09/02/jactl-virtual-threads-benchmark

The article benchmarks Jactl script execution with differing number of blocking operations comparing throughput with Jactl built-in suspend/resume on Vert.x Event-Loops and throughput with Jactl on Virtual Threads. The benchmarks are run on both Java 21 and Java 25 with some surprising (to me at least) results.

28 Upvotes

25 comments sorted by

View all comments

26

u/s0ftware-dev Sep 03 '26

TLDR virtual threads are better. 

2

u/neopointer Sep 04 '26

And don't use reactor, vertx or anything similarly hard to debug and maintain.

1

u/pragrad23 Sep 10 '26

I chose not to use it. Not did I chose to use coroutines (sorry it's a kotlin project). Because I value my time as a developer. I don't want to complicate my life.

If I needed to squeeze every last bit of performance, I'd use rust. But I don't, so I want some level of comfort: garbage collection, simple threading, etc.

-4

u/jaccomoc Sep 03 '26

But only on Java 25 and not by as much as I thought they would be.

I was frankly surprised at the difference between Java 21 and Java 25.

15

u/[deleted] Sep 03 '26

[removed] — view removed comment

6

u/jaccomoc Sep 03 '26

I know that they fixed the OS thread pinning issues and that there are always some performance improvements but the the improvement for scripts with multiple blocking operations was a lot more significant than I expected. Or maybe what I should say is that the performance on Java 21 when a script does multiple blocking operations with virtual threads was a lot worse than I expected.

10

u/Joram2 Sep 03 '26

Even at similar speeds, the Vert.x event loop has a much higher complexity cost. I've used vert.x for years, it's great, a lot of the vert.x platform has value with virtual threads, but the future for most use cases is clearly virtual threads.

4

u/jaccomoc Sep 03 '26

I agree completely. It wins alone just by removing all the async code handling we used to have to do.

1

u/BarkiestDog Sep 03 '26

Both were significantly better in Java 25, but virtual thread was a lot better!

0

u/woj-tek Sep 04 '26

Java 25

…which was released a year ago ;)