Re:Helidon Níma: The first Java microservices framework base...
by xcv123 on Saturday August 19, 2023 @05:01PM
(#37193146)
The difference now is that it's implemented in the JVM instead of a library / framework. It is easier, simpler, and probably more efficient. You can get higher throughput from existing code with minor refactoring.
Thread thread = Thread.ofVirtual().start(() -> System.out.println("Hello"));
thread.join();
Re:Helidon Níma: The first Java microservices framework base...
by mikmoila on Saturday August 19, 2023 @05:38PM
(#37193515)
Also there are some traceability issues involved in using asynchronous APIs: "In the asynchronous style, each stage of a request might execute on a different thread, and every thread runs stages belonging to different requests in an interleaved fashion. This has deep implications for understanding program behavior: Stack traces provide no usable context, debuggers cannot step through request-handling logic, and profilers cannot associate an operation's cost with its caller. "
Re:Helidon Níma: The first Java microservices framework base...
by saagarjha on Sunday August 20, 2023 @01:23AM
(#37196360)
In theory an async-aware runtime can stitch together a coherent and useful backtrace, but in practice most legacy tooling won’t :(
Re:Helidon Níma: The first Java microservices framework base...
by ElectricalUnion on Monday August 21, 2023 @05:33PM
(#37215650)
Collecting those potentially very expensive stack traces, specially in those highly concurrent environments with high throughput requirements would be great for debugging but probably is gonna kill the performance of the system. But it would be nice (even if as a very heavy hammer) as an option.
Re:Helidon Níma: The first Java microservices framework base...
by Tainnor on Saturday August 19, 2023 @05:15PM
(#37193290)
I'm not saying that virtual threads aren't a good thing (other runtimes than the JVM have had green threads for a very long time now), but that it doesn't seem like such a paradigm shift. It's still threads (with all the benefits and drawbacks), it's just now that they have less overhead.
Presumably I could just keep an existing server written in Spring MVC or a similar technology and just wait for the underlying container to support virtual threads to get the same benefits. I believe Jetty already does support them. So why would I need a new framework?
Re:Helidon Níma: The first Java microservices framework base...
by xcv123 on Saturday August 19, 2023 @05:28PM
(#37193411)
It removes the need to write async code in many cases. It is a more straightforward and efficient way to accomplish what we have already been doing for years on the JVM.
You don't need to switch frameworks
Yeah I got that. But then the use case seems to be much narrower, because not every scenario is one where many concurrent requests come in at the same time. If you write non-blocking code you'll get high throughput no matter the number of requests. Ok, maybe non-blocking code is harder to write (and I don't think it's actually that hard if you use, say, Kotlin coroutines), but honestly this seems to me like something that developers should learn eventually anyway.
Or maybe it's me being weird. But I remember 10 years ago when node.js was being hyped for being "fast" because it was "async" and now suddenly using threads and blocking operations is again all the rage now.