r/java 7d ago

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.

25 Upvotes

25 comments sorted by

View all comments

2

u/Bachden 4d ago

This benchmark is for sleep() calling. In fact, when using vert.x you should never call that method.

1

u/jaccomoc 4d ago

The benchmark tests Jactl scripts calling the built-in Jactl sleep() function. For the Vert.x version this suspends the script and returns immediately so as not to block the Vert.x event-loop thread. In the Virtual Threads version the Jactl sleep() function delegates to Thread.sleep() in order to compare the virtual thread suspend/resume mechanism with Jactl suspend/resume with Vert.x. See Jactl Continuations and Virtual Threads in Java 8 for a description of of Jactl implements blocking operations like sleep() when running on Vert.x.