<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 31/10/2023 17:59, Ilya Starchenko wrote:<br>
<blockquote type="cite" cite="mid:CAD0tGQvD-5inG+s6NHcPcVokaMW9FMOgtKvVTwOvXrmdQgZwQQ@mail.gmail.com">
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Hello
loom-dev team,</p>
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;min-height:14px"><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">I
would like to express my gratitude for the work being done on
Project Loom. It's an exciting project with a lot of potential.
I have some questions related to its performance that I would
appreciate some clarification on.</p>
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;min-height:14px"><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">I
recently came across a benchmark presentation by Alan Bateman at
Devoxx<<a href="https://youtu.be/XF4XZlPZc_c?si=-Qp2PampTbNGj3a5" moz-do-not-send="true" class="moz-txt-link-freetext">https://youtu.be/XF4XZlPZc_c?si=-Qp2PampTbNGj3a5</a>>,
where the Helidon Nima framework demonstrated better performance
results compared to a reactive framework. However, when I
examined the Plaintext benchmark (specifically focusing on Netty
and Undertow, which benchmark only plaintext), I noticed that
Nima, which operates entirely on virtual threads, failed to
outperform even the blocking Undertow. Additionally, I conducted
tests with Tomcat and Jetty using Loom's executor, and they also
did not exhibit significant improvements compared to a reactive
stack. Perhaps I should ask the Helidon team, but my question
is, is this the expected performance level for Project Loom, or
can we anticipate better performance in the future?</p>
</blockquote>
<br>
Slide 11 in that presentation is where I showed Heldion 3 vs.
Heldion 4 results. The slide has a link to the results published on
<a class="moz-txt-link-abbreviated" href="http://www.techempower.com/benchmarks">www.techempower.com/benchmarks</a>. There may be some Helidon
maintainers on this mailing list to say more about this. The slides
were dulled in the recording (it happened to a few other too) but
you can find the original slides here if you want:<br>
<br>
<a class="moz-txt-link-freetext" href="https://cr.openjdk.org/~alanb/devoxx2023/ProjectLoomDevoxx2023.pdf">https://cr.openjdk.org/~alanb/devoxx2023/ProjectLoomDevoxx2023.pdf</a><br>
<br>
<br>
<blockquote type="cite" cite="mid:CAD0tGQvD-5inG+s6NHcPcVokaMW9FMOgtKvVTwOvXrmdQgZwQQ@mail.gmail.com">
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;min-height:14px"><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Furthermore,
I took a closer look at the Poller implementation<<a href="https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/nio/ch/Poller.java#L436" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/nio/ch/Poller.java#L436</a>>,
and I noticed that it utilizes only one thread (by default) for
both read and write polling. I'm curious why there's only one
thread, and wouldn't it be more efficient to have pollers
matching the number of CPU cores for optimal performance?</p>
<br>
</blockquote>
This code is significantly replaced in the fibers branch of the loom
repo. We have a draft PR to bring this into the main line for JDK
22. The main difference is that the number of epoll instances is
based on the number of hardware threads, actually the closest power
of 2, with a virtual thread per instance. The effect of this is to
integrate I/O event handling with the virtual thread scheduler which
works surprising well under load. I don't know if you build the JDK
from source; if you do then you can add that to the list to test.<br>
<br>
-Alan<br>
<br>
<br>
</body>
</html>