4 ms·
We tried to use it to improve AWS lambda startup times but desisted as it was a pain to use it with an existing app. It required too many tweaks as there are w
by gzalo 3y ago
We tried to use it to improve AWS lambda startup times but desisted as it was a pain to use it with an existing app.
It required too many tweaks as there are waay too many things that rely on reflection :(
Things that broke include:
JSON (de)serialization using Jackson, validations using hibernate, validator, AWS SDK, and even simpler libs like picocli...
It could be quite useful for a set of simpler apps though
- jiehong 3y agoPicocli allows using a compiler annotation processor to generate classes at compile time instead [0]. [0]: https://github.com/remkop/picocli/blob/main/picocli-codegen/README.adoc https://github.com/remkop/picocli/blob/main/picocli-codegen/...
- AndyPa32 3y agoYes, Jackson really was a bummer. To this day I can't understand how a project like Springboot advertises Graalvm readiness when Jackson is not supported without tweaks. What do the Springboot devs think we are using Springboot for, Hello World blog posts?
- CrimsonRain 3y agoWhat's wrong with it? Genuinely curious. I've using Graal with spring/Jackson for a long time and haven't noticed any issue.
- JacobiX 3y agoFrom my understanding, Spring Boot takes care of providing the JSON metadata for many libraries, including Jackson. So in practice, it can be more straightforward to use it in a Spring Boot project.
- eddythompson80 3y agothis was our experience as well. Both with GraalVM/Quarkus and .NET CrossGen/Native/CoreRT. It's almost a different platform that's far less supported and less stable. Even if you put in the work to make things work, they'll eventually break. Quarkus tries to give a full experience like Kotlin Native, but both are also not really there. It's really unfortunate how Java and C# are perceived as slow because of their painful startup time.
- wizwit999 3y agoye even less relevant for that usecase with snapstart.
- wink 3y agoSnapStart for Java 17 was only released very recently, so if you are a bit early in the cycle it doesn't help. Don't even want to guess when it will be available for Java 21.
- invalidname 3y agoGraalVM has an agent you can use to run your project. It then generates the dependency file for you and you can then use that file to compile the native code. If you use a framework like Spring Boot then you don't even need that. Just upgrade to 3+ and Jackson, Hibernate (and maybe these other APIs) should pretty much work out of the box.
- pharaohgeek 3y agoLook at the Quarkus framework. It's designed with Graalvm native in mind, so it knows how to handle Jackson, AWS, etc. and compile them to a native binary. I'm using it in production with a native-compiled Lambda that calls other AWS services. It works GREAT!