Java virtual threads: 15x faster I/O, no help for CPU-bound work
An 8,000-trade settlement benchmark shows Java virtual threads deliver a 15x speedup for I/O-bound work but offer no advantage for CPU-bound Monte Carlo simulations.
A T+1 stock settlement simulator built to test Java's Project Loom draws a sharp line between where virtual threads help and where they don't. In an I/O-bound benchmark settling 8,000 trades, virtual threads ran roughly 15x faster than a 200-thread platform pool while using a tenth of the OS threads, because tasks spend most of their time waiting and virtual threads can unmount from their carrier during that wait.
The piece also flags the pinning trap: blocking calls inside a synchronized block prevent a virtual thread from unmounting, silently collapsing effective concurrency back toward carrier-pool size. This failure mode doesn't throw an exception, making it hard to diagnose in production; the -Djdk.tracePinnedThreads=full flag is recommended for finding these spots, and JEP 491 in JDK 24 finally removes the restriction.
The CPU-bound test flips the result. Running 20,000 Monte Carlo simulations per trade to compute Value-at-Risk on the same 8,000 trades, virtual threads barely beat a plain sequential loop and landed in the same narrow performance band as a fixed thread pool and a parallel stream. With no idle time to reclaim, every strategy is ultimately capped by the number of physical CPU cores.
The takeaway for engineers: virtual threads solve a scheduling problem, not a compute-capacity problem. They deliver major wins for I/O-heavy services but add only scheduler overhead for pure CPU work, so the right concurrency tool still depends on the nature of the workload.