Re:Show HN: I finished v5 of a JVM framework I've spent spen...
by tipsee on Monday October 03, 2022 @01:29PM
(#33070786)
If you run this on JDK19 with *--enable-preview*, Javalin will use Virtual Threads for the Server ThreadPool (as well as all other ThreadPools it has).
[ Parent
| on HN ]
Re:Show HN: I finished v5 of a JVM framework I've spent spen...
by daveidol on Monday October 03, 2022 @01:48PM
(#33071075)
How does it compare to coroutines in Kotlin?
Re:Show HN: I finished v5 of a JVM framework I've spent spen...
by tipsee on Monday October 03, 2022 @01:56PM
(#33071195)
I mean, it sort of doesn't? Coroutines is a whole concept, Virtual Threads can in most cases just replace java.lang.Threads, which is how it's implemented in Javalin. We just swap out the OS Threads for Virtual Threads.
Re:Show HN: I finished v5 of a JVM framework I've spent spen...
by stefs on Monday October 03, 2022 @01:58PM
(#33071229)
i'd be interested in this too. my guess: virtual threads are slightly more memory efficient and slightly faster, but same ballpark.
Re:Show HN: I finished v5 of a JVM framework I've spent spen...
by stefs on Thursday October 06, 2022 @09:07AM
(#33107737)
now that i think about it i'm pretty sure my guess is completely wrong. memory usage (and thus concurrent-inactives) might be similar, but i expect the virtual threads to be much more efficient.