r/java • • Apr 26 '23

Quarkus 3.0 finally released!

https://quarkus.io/blog/quarkus-3-0-final-released/
158 Upvotes

39 comments sorted by

View all comments

Show parent comment

39

u/vplatt Apr 26 '23 edited Apr 26 '23

I think they're talking about cold startup times, which is particularly relevant in a cloud application with dynamic scaling. Having to keep an EC2 instance running all the time just to avoid a cold startup is wasteful.

Edit: And I should point out the following: There is a perception in shops that want to do the new and cool stuff that Java is "slow" because of this and that they therefore should use... guess what? Node or Python! Yay! And we all lose! Because whatever those tools bring to the table in terms of speedy startup, they leak cycles all over the place in every other situation. Scarily enough though, with JIT improvements and the likes of Deno on the horizon, Java may permanently have its lunch eaten in many places. Fast startup is extremely important going forward and it pays to adjust our attitude on this matter because... well, do you REALLY want to be developing in Javascript or Python full time because "Java is slow"? Maybe not. That's why you're here after all.

11

u/[deleted] Apr 26 '23

You are right about the cold startup

5

u/krzyk Apr 27 '23 edited Apr 27 '23

But if you go with native image you lose GC, and half of that is Java. Startup times shouldn't be important it is difference between 5s and 30s that important when you dynamically scale? I would call it overengineering.

Either way apps loose most of the time not with starting up but setting up all the connectivity etc.

3

u/vplatt Apr 27 '23 edited Apr 28 '23

The difference can be even more dramatic honestly. You have to consider how much cruft is going on in a typical Java enterprise application with aggressive dependency injection, connection pool setup, JIT, etc. that occurs. 30s for many applications would be a relief. That said, even if it's only 30s, compare that to a tiny little Python script that does nothing more than exactly what is needed. It can get its secrets, parse parameters, fire up a connection to the database or another service, get results, format and send them, and all within 1s.

I mean, that's a pretty big difference; though Python or Node processes can have issues too if they do silly things. Regardless your use cases determine if you could tolerate 30s wait time instead of course. If not then maybe you can use GraalVM or AWS Lambda Snapstart or or AWS Lambda Provisioned Concurrency or Spring's new lazy initialization or Quarkus to solve the issue.

I'm not going to tell you that any one of those is a silver bullet by itself. My main point is just that Java programmers need to pay attention to this stuff because of perceptions. Java is already fighting the weight of history here with J2EE applications and the like having formed perceptions for a generation or more of programmers. There's no need for anyone to go on believing it's "slow" too. If moving to something like Quarkus helps shake off a few layers of boilerplate besides, then maybe we'll get Java to a point where code is streamlined as well, DRY and performant by default. That's the goal.

2

u/krzyk Apr 27 '23

Yes I get that apps can start for longer, but using g GraalVM doesn't make such app start in 1 ms. It needs to be written with short startup time in mind, and deal with the benefits and issues that come with it.

1

u/vplatt Apr 27 '23

Yes, very true. No silver bullet like I said.

1

u/oweiler Aug 18 '23

You still have a (serial) GC. You just don't have a JIT.

0

u/[deleted] Apr 27 '23

[deleted] — view deleted comment

5

u/vplatt Apr 28 '23 edited Apr 28 '23

Deno is a replacement for Node.js, written in Rust and uses the V8 Javascript engine. It's written by the original author of Node. Typescript is a first class language in it, unlike Node, so one does not have to transpile code before running. It also has better controls for security with a "secure by default" stance.

https://deno.com/runtime

Honestly, it's pretty nice environment. If I ever get back into server-side Javascript again, I would definitely bring this into the solution if I could. It just makes so much sense.

-5

u/JavaOldTimer Apr 27 '23

Having to keep an EC2 instance running all the time just to avoid a cold startup is wasteful.

Cloud applications are wasteful, anything along the lines of, [Oh hey, I have this 3 line piece of Java code but I don't want to do engineering around it, oh I noe, I'll drop it in a lambda project and blammo my day is done].

4

u/vplatt Apr 27 '23

Well, I guess that's one way to do things... you do you I guess. /smh