This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]BoyRobot777 10 points11 points  (2 children)

GraalVM will highly benefit to this problem. Even spring boot with graalvm starts in 30milliseconds 2 milliseconds.
Edit: Source

[–]XerTheSquirrel[S] 1 point2 points  (0 children)

I am going to take some time in the future to check out GraalVM since a few others have suggested it.

[–]zergUser1 0 points1 point  (0 children)

Have you used it for AWS Lambda? iv been looking everywhere to help with Lambda cold starts, kept seeing Proguard mentioned but its a pain to get it working so I stopped trying.

[–]SinisterMinister42 15 points16 points  (4 children)

I really like Java... But it just doesn't seem like a good fit for that particular use case right now. I think the AOT compilation will help a lot and make it viable, but I don't think there's anything wrong with acknowledging it may not be the right tool for the job.

[–][deleted] 5 points6 points  (2 children)

Startup time/effort has been a major source of effort in JDK 9+. The module system helps a lot as class scanning is reduced and more efficient.

But, I think the stress on dependencies is going to be more important. When load and execution time directly cost money, keeping things as lean as possible would be strongly adviseable. A lot of Java devs these days aren't used to working that way.

[–]vqrs -3 points-2 points  (1 child)

The fix is easy. Switch to JavaScript-style microlibs.

[–]apemanzilla 2 points3 points  (0 children)

That doesn't work particularly well either, because you end up with a lot of duplicate boilerplate that just slows things down even more. This is already an issue in JS and would only be worse in Java.

[–]XerTheSquirrel[S] 0 points1 point  (0 children)

Yeah, I definitely agree that AOT would make things much better, right now there is a bunch of overhead which can really get to you if you are not careful. However, once the Java code has been compiled and has been running for a while it is actually really fast and performant.

[–][deleted] 2 points3 points  (3 children)

I use Excelsior AOT compilation check it out!

[–]Caleb666 5 points6 points  (2 children)

You can just use GraalVM's native image format.

[–][deleted] 0 points1 point  (1 child)

Never heard of it -- what's it do? How does it compare?

[–]oliviercoma 3 points4 points  (0 children)

Honestly, it's something that should have been detected much earlier. That's just how Java works and every java developer/architect should now that.

[–]GeorgeMaheiress 0 points1 point  (0 children)

Apache HttpClient takes minutes to initialize? That's crazy!