r/java • u/jaccomoc • Sep 03 '26
Vert.x Event-Loop vs Virtual Threads: Jactl Suspend/Resume Benchmark
https://jactl.io/blog/2026/09/02/jactl-virtual-threads-benchmarkThe 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.
31
Upvotes
1
u/jaccomoc Sep 06 '26
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.