Is it normal for Micronaut to take ~75 seconds to start it's hello-world example project? This seems very much at odds with the way the framework has been described. I am running this on a MacBook pro with decent specs and the project was created following the steps in the Micronaut User Guide without any customization. The same happens whether I start from my IDE or the uber jar.
java -jar ./libs/hello-world-0.1-all.jar
04:53:39.715 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 76248ms. Server Running: http://localhost:8080
FWIW, I was intrigued by Micronaut since I stumbled across it a few months back in part because Spring has become too bloated and I was looking for alternatives. I was planning to build a simple REST service and compare it with the same service in SpringBoot but I view this slowness as a blocker.
At first I was thinking that this might be the Annotation Processors doing their IOC stuff but, that can't be the culprit because it is just as slow using the uber jar which shouldn't incur this cost. Any ideas?
Check your hostname with:
hostname
and add it to /etc/hosts
for 127.0.0.1
and ::1
addresses.
According to Micronaut's official guide there is a known bug causing delay when calling java.net.InetAddress.getLocalHost()
on Mac OS when the hostname is not present in the /etc/hosts
file.
/etc/hosts
127.0.0.1 localhost <hostname>
::1 localhost <hostname>
https://docs.micronaut.io/latest/guide/index.html#problems
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With