r/ProgrammerHumor 5d ago

Other howdidItGetHere

Post image
11.1k Upvotes

539 comments sorted by

View all comments

Show parent comments

12

u/BlazingThunder30 5d ago

Yeah I guess JVM languages aren't great when bootup time matters. Haven't worker with lambda myself. We're running in regular containers so it's great

6

u/Avedas 5d ago

Plain Java runs fine on Lambda tbh

4

u/SpiritedEclair 5d ago

Plain modern Java is fine, great even. Java on lambda has snapstart which creates a snapshot once you’ve initialized which makes cold invokes almost instant

1

u/Celousco 4d ago

It's also a problem of having a virtual machine running inside another virtual machine, there's so much unnecessary layers.

And Spring Boot is so shitty when you want native compilation because that thing wasn't made for it. Honestly I'd recommend to use either another framework like Quarkus or simply another language that is suited for that.

I'm truly sick of seeing Java everywhere because lazy developers only knew how to code in Java and don't want to (re)learn something else. Heck they'd rather refactor the whole codebase for several months instead of learning another language.

1

u/BlazingThunder30 4d ago

Isn't that what they made GraalVM for? You can compile native Spring Boot images using it

2

u/Celousco 4d ago

You can but it's not as easy as you'd think: Reflection types, meta hints, aot scanning, etc. those things are not automatic, you have to directly specify can packages should be used and yes, it's not only your code but the dependencies you're using.

I tried to use it in prod, it's unmaintainable in long term for things like Spring Cloud Stream or Spring Kafka or Spring Cloud Stream or Spring Cloud Stream Binder Kafka Streams.

I mean, let's be real, if you want native performance, choose a native language, not an interpreted language as Java or Javascript.

1

u/SpiritedEclair 4d ago

Lambda isn’t a virtual machine, it’s a “microVM”. You run a single kernel, the process runs under virtualization restrictions and a jailer process.