Entries tagged [threads]
Virtual threads with Notes/Domino 14.5+
by Richard Pajerski
Posted on Monday April 20, 2026 at 09:23PM in Technology
Java Virtual Threads (https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html) have been directly available to Notes/Domino developers since HCL began shipping Java 21 (or more accurately OpenJ9) with release 14.5 in June 2025. But when should we use virtual threads? In theory, any Notes/Domino Java workload that currently depends on platform threads could benefit (at least in efficiency) by moving to virtual threads.
Measuring efficiency can be complex and case-specific so deciding to use one thread type over the other is something that has to be tested. But some basic tests demonstrate that virtual threads "complete" much more quickly than platform threads and more noticeably so as concurrent threads climb into the thousands.
Our two test programs are nearly identical.
Platform threads
Virtual threads
The key lines are:
Platform threads:
Thread thread = new Thread(new Runnable() {
Virtual threads:
Thread thread = Thread.ofVirtual().start(new Runnable() {
Windows 11 workstation:
Fedora Linux 43 workstation:
(in this case, the speed differences between operating systems are primarily due to different hardware)
For even higher numbers of concurrent threads, the situation gets proportionally worse; here are the results for one million threads (both on Windows):
Platform:
Task 1000000 completed in 27465ms
Virtual:
Task 1000000 completed in 1454ms
So we go from around a 1.4x improvement with 2,000 virtual threads to close to a 20x improvement with 1M threads.
These tests don't perform any useful work (and are obviously not specifically tied to Notes/Domino) but the differences alone suggest that virtual threads will outperform platform threads once they have real work to do. There are a number of reasons for virtual threads' improved performance but the amount of system resources per platform thread and the removal of OS-level context switching are probably the most consequential. A good summary of the motivations and goals for introducing virtual threads into the OpenJDK can be found here and here.