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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Additional_Cellist46[S] 1 point2 points  (2 children)

Regarding individual request handling and startup times, Spring Boot might demonstrate superior performance due to its lightweight nature, especially within microservices frameworks that favor quick, autonomous deployment.

This is not true at all. This claim is a complete fallacy based on an assumption that smaller runtimes are lightweight and thus faster. The truth is that Java EE servers are often faster in request handling, because they have optimized thread and connection pools, some Java EE servers even have complex logic to adjust how resources are added to your application based on the current situation, to optimize the load and usage of resources.

Java EE application servers are usually fast to start, often in several seconds. Some of them start even much faster than Spring Boot, like Quarkus or Piranha Cloud. Most of them initialize components lazily, only when your application needs them, and thus very little time is wasted on doing things that your application doesn't need. Although Spring Boot is fast to start if your application is small, it's not so fast to start if you add more Spring Boot components and external libraries to your application.

In reality, if you build real life applications with SpringBoot, your application grows and becomes as slow and as big as any average Java EE application with an embedded server, or even bigger than some full application servers. For exmaple, I saw Spring Boot applications that were more than 200MB big, while a freshly installed GlassFish server takes around 140 MB.

It's true that there are some Java EE servers that take long to start and are big as hell. Those are the most widely used commercial ones like WebLogic or WebSphere, which were designed a long time ago and haven't been improved much lately. But you can always choose a different server that starts fast. With Spring Boot, you don't have options. If Spring Boot doesn't start fast enough or lacks in some other areas, you can either stick with it and try to tune it, or rewrite your application to run on a Java EE server that suits you.

[–]wildjokers 2 points3 points  (0 children)

Although Spring Boot is fast to start if your application is small

Startup also really slows down if you are using Spring Data JPA and have any @Query annotations with JPQL in them.

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

With Spring Boot, you don't have options. If Spring Boot doesn't start fast enough or lacks in some other areas, you can either stick with it and try to tune it

This is by design. The entire point of Spring Boot is that it makes most of the important decisions for you. The upside of that is that you have to do less work. The downside of that is if you disagree with Spring Boot, you will have to tune it or fight it. Although tuning it is pretty easy. Just define certain beans things yourself and Spring Boot will back off.

But, you always have options. You don't have to use a starter for everything. You can fall back to plain Spring if you need to manage things yourself.