Understanding Virtual thread performance for quick API calls

Alan Bateman Alan.Bateman at oracle.com
Thu Jul 25 09:58:24 UTC 2024


On 25/07/2024 10:12, David wrote:
> Hi,
>
> I'm looking for some insight into some benchmark performance [1]. I'm 
> comparing the performance of Virtual threads and Platform threads by 
> submitting 10_000 tasks that perform 1 or 2 API requests to either 
> a newVirtualThreadPerTaskExecutor or an 
> Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()).


It might be useful to collect some data on the number of HTTP 
connections. For your thread pool test you've limited the concurrency so 
you've N connections and likely benefits greatly from HTTP keep alive.  
It will likely be different in your virtual threads test, in the extreme 
it might have 10_000 connections. If you can get some data on that then 
it might help the analysis.

-Alan


More information about the loom-dev mailing list