Interesting Benchmarks

Eric Kolotyluk eric at kolotyluk.net
Tue Nov 9 04:19:56 UTC 2021


Thanks for the insights Ignaz...

Yes, I am using Executors.newThreadPerTaskExecutor(threadFactory), but I am
new to this API. At this point, I don't really care if I did have 5,000,000
Platform Threads running, only wanted to compare the throughput of Platform
Threads to Virtual Threads. If you are suggesting this was not a good
experiment, I want to correct that.

I can see now some more mistakes I made, so will have to rerun the
benchmarks again.

Cheers, Eric





On Mon, Nov 8, 2021 at 12:50 PM Ignaz Birnstingl <ignazb at gmail.com> wrote:

> Hi Eric,
>
> > I would
> > not have thought it possible to run 5,000,000 Platform Threads.
>
> As far as I can tell by looking at your code you didn't. I think you
> submit the tasks sequentially to an ExecutorService created with
> Executors.newThreadPerTaskExecutor(). This causes many tasks (=threads)
> to
> end before the last one is submitted.
>
> I would suggest you use a different (thread caching) ExecutorService for
> platform threads. Otherwise you are mainly measuring thread creation time
> of virtual threads vs platform threads.
>
> Ignaz
>


More information about the loom-dev mailing list