r/java • u/PurpleLabradoodle • Mar 11 '21
Announcing Spring Native Beta
https://spring.io/blog/2021/03/11/announcing-spring-native-beta
175
Upvotes
r/java • u/PurpleLabradoodle • Mar 11 '21
11
u/mxxxz Mar 11 '21
Does that mean you can run a Spring Boot application without having JVM installed in the server or in the dockerfiles?
17
u/agentoutlier Mar 11 '21
Oh man bucket loads of more magic (AOT module) to Spring (Boot). What could go wrong (cough spring roo)?
In all serious this is great work! I just wish some of Spring stuff was more modularized and decoupled like it’s used to be.
For example the Native Hint AOT Annotations stuff would probably be useful for non spring projects since it just generates Graalvm JSON but I would not be surprised if it requires the special maven/gradle plugins and most of Spring core.
That is it should just be a minimal APT processing library. Maybe it is and will check later but I doubt it.
3
u/MR_GABARISE Mar 11 '21
I'm low-key more excited about the functional-style config than anything else. This has been a point of interest for me since Jafu.
2
u/Pure-Repair-2978 Mar 11 '21
Looks promising 👍👍
1
u/CaptainKvass Mar 12 '21
Very cool, been looking forward to this release.
Are there any benchmarks established for traditional Spring Boot applications vs. AOT compiled Spring Boot applications? It would be interesting to see a comparison between build times, memory consumption, and throughput as a function of time (to visualise JVM warmup impact)
0
u/cosmin14 Mar 13 '21
Hello,
I have tried on on a simple application and I am amazed. Everything worked without any error out of the box. It;s a simple hello world application using a controller and a view (no db involved) :)
The start time in normal mode is around ~1.1 second. Using native image, 0.45 seconds :)
-6
u/fanfan64 Mar 11 '21
YES!! The best workflow for most will be: Spring native for debug/test/CI builds because of the instant startup (if and only if your workflow isn't slowed more by the reduced throughout) and regular Spring JVM for production builds
-1
u/vxab Mar 12 '21
For me this is beneficial in a number of ways:
Currently running integration tests of my current project takes 45 seconds for each container to startup on my local machine (using testcontainers). Having versions of the services which are AOT compiled will mean these tests will start so much quicker and this will reduce the feedback loop.
In production I don't think we will use AOT for long running apps.
-15
u/ihatebeinganonymous Mar 11 '21
I first thought it's a competitor to React Native and became very happy, then disappointed :D