Open jbonofre opened 3 weeks ago
IMHO we should be really careful with Java virtual threads, because those are not a "just turn it on and everything's faster & better" thing. VTs come with quite some fine-print. In a nutshell: everything that runs on a VT must meet a bunch of criteria - otherwise the stability of the whole process is at risk, likely not in every environment ("number of CPUs").
Few posts that discuss this topic:
Agreed that we should look into optimizing this, though I don't know enough about virtual threads to have a strong opinion about the implementation. @snazy's concerns above seem valid.
Long-term, I am hoping that @flyrain's recent proposal will let us fully delegate this kind of work to an external service and make this problem moot.
VirtualThreads have been added in JDK19+. It's good improvement on "regular" threads. The Polaris
TaskExecutor
is using regular threads for now. Using virtual threads should provide a performance boost.