DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Upgrade Guide To Spring Boot 3.0 for Spring Data JPA and Querydsl
  • Improving Backend Performance Part 1/3: Lazy Loading in Vaadin Apps
  • Spring Data: Easy MongoDB Migration Using Mongock
  • Introduction to Spring Boot and JDBCTemplate: Refactoring to SpringData JPA

Trending

  • Building AI-Powered Java Applications With Jakarta EE and LangChain4j
  • Getting Started With Agentic Workflows in Java and Quarkus
  • Multi-Scale Feature Learning in CNN and U-Net Architectures
  • Building a Production-Ready AI Agent in 2026: Beyond the Hello World Demo
  1. DZone
  2. Coding
  3. Frameworks
  4. Performance Comparison: Spring Boot + Spring Data vs. Micronaut + GORM

Performance Comparison: Spring Boot + Spring Data vs. Micronaut + GORM

This article analyzes the performance differences between Spring Boot and Spring Data versus Micronaut and GORM.

By 
Ravi Isnab user avatar
Ravi Isnab
·
Updated Oct. 23, 18 · Analysis
Likes (8)
Comment
Save
Tweet
Share
15.6K Views

Join the DZone community and get the full member experience.

Join For Free

------------------------------------------------------

Update 10/23/2018 12:30 pm PDT:

------------------------------------------------------

With the latest release of micronautv1.0.0, it matches Spring without any changes to bombardier i.e. it's keeping the connection alive by default now.

For more information: check the original blog post.

Thanks to Micronaut team to responding so quickly to this post.

------------------------------------------------------

Update 10/23/2018 8:45 am PDT:

------------------------------------------------------

With the keep-alive connection header while testing with bombardier, micronaut provides the same results as Spring. Please review blog to see the most updated results.

You can find the result output for all of the run(s) here.

If you are interested in latest run with bombardier with keep-alive that output is here.

All the result outputs are here.

------------------------------------------------------

Update 10/23/2018 7:38 am PDT:
------------------------------------------------------


I have been working with Micronaut's team and they have quickly found the reason why bombardier tests provide such different results. bombardier closes the connection after every request and hence the huge discrepancy in the result. To address this Micronaut 1.0.GA would release with Http 1.1 default of keeping the connection open. I will be updating this article as soon as I can get hands on it. I will be updating the article pretty soon here with the results of providing Connection:keep-alive header with bombardier on Micronaut 1.0.0.RC3

---------------------------------------------------------------------------------------------------------------------------

Recently, I came across the Micronaut framework and found it to be very interesting. It provides a low memory footprint and fast bootup time. I have used Micronaut now for a couple of non-database-backed applications and it starts up really fast and is performing really well. In my performance tests comparing a Micronaut app to a Spring app, Micronaut performed better (this will be covered in a separate post).

The next step for me was to see if I could recommend Micronaut for database-backed applications. Micronaut works with straight-up Hibernate and even provides GORM (a Spring Data alternative). I am already familiar with Spring Data, so I am curious about GORM. I decided to give it a spin and see how it holds up compared to a Spring Data app.

You can find my repository on GitHub.

Details of the test:

  • This is a very basic application with a single domain object: Person.
  • Three records were inserted into an in-memory H2 database at startup time.
  • Only GETs are tested.
  • I haven't tweaked any of the apps for better performance — this is as out-of-the-box as we can get.
  • Spring Boot v2.0.6 is used Micronaut: 1.0.0.RC3 is used.
  • OS: MacOS High Sierra, 16 GB RAM, 2.5 Ghz Intel Core I7.
  • The mvn and java versions are as follows:
$ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T12:39:06-07:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_162, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
  • I used different tools (bombardier, ab, loadtest for performance tests since each one of them offers different results).

Results

Tabular comparison: Total time to complete requests = total time

Image title

Summary

  • Micronaut has a much faster startup time than Spring.
  • With bombardier, the Spring data app blows the Micronaut app out of the water as far as throughput is concerned.
  • With ab, micronaut wins by a slight margin.
  • With loadtest, it's too small a difference to decide.

Next Steps

This is probably going to be an in-progress article. I will add more information as I gain it. I will

  • Try a different load test tool.
  • Try loading these applications in a container to take my machine out of the picture.
  • Try a more real-world scenario, e.g. more entities and real relationships between them and constraints on domain classes.

Please feel free to share your thoughts/comments on the article. Try this out on your machine and feel free to share your results. Just be nice!

Spring Framework Spring Data Spring Boot Data (computing) Gorm (computing) Comparison (grammar) app

Published at DZone with permission of Ravi Isnab. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Upgrade Guide To Spring Boot 3.0 for Spring Data JPA and Querydsl
  • Improving Backend Performance Part 1/3: Lazy Loading in Vaadin Apps
  • Spring Data: Easy MongoDB Migration Using Mongock
  • Introduction to Spring Boot and JDBCTemplate: Refactoring to SpringData JPA

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook