Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JNation 2025 - Quarkus for Spring Developers

JNation 2025 - Quarkus for Spring Developers

In this session, I will show concepts and conventions familiar to Spring developers and how those same concepts and conventions can be implemented in Quarkus, all while highlighting similarities and differences between them. Additionally, I will show similarities and differences in how testing is done, highlighting Quarkus Dev Services.

This session will be mostly live coding while minimizing the amount of slides. I will introduce an existing Spring application with a full test suite and build a Quarkus equivalent version of it, live.

Avatar for Eric Deandrea

Eric Deandrea

May 27, 2025
Tweet

Video

More Decks by Eric Deandrea

Other Decks in Technology

Transcript

  1. @edeandrea Who’s on Stage Today? Eric Deandrea 🤘 26+ years

    software development experience Java Champion 🤘 Contributor to Open Source projects Quarkus Spring Boot, Spring Framework, Spring Security LangChain4j (& Quarkus LangChain4j) Wiremock Microcks 🤘 Boston Java Users ACM Chapter Board Member 🤘 Published author
  2. @edeandrea • How Quarkus enables modern Java development & the

    Kubernetes-native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Emphasis on testing patterns & practices https://red.ht/quarkus-spring-devs
  3. @edeandrea The Warmup Issue with Java Simon Ritter - Azul

    Systems - https://youtu.be/bWmuqh6wHgE (first 13 minutes)
  4. @edeandrea Build Time Runtime Packaging (maven, etc) gradle…) Load config

    file from file system Parse it Classpath scanning to find annotated classes Attempt to load class to enable/disable features Build its model of the world. Start the management (thread, pool…) @ @ </> How Does a Framework Start?
  5. @edeandrea JVM Build Time @ @ </> Package model Native

    The Quarkus Way enables Native Compilation
  6. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining Holly Cummins - https://youtu.be/vnrXXvnqriA
  7. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining Holly Cummins - https://youtu.be/vnrXXvnqriA
  8. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining Holly Cummins - https://youtu.be/vnrXXvnqriA
  9. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining Holly Cummins - https://youtu.be/vnrXXvnqriA
  10. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining Holly Cummins - https://youtu.be/vnrXXvnqriA
  11. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate Holly Cummins - https://youtu.be/vnrXXvnqriA
  12. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) Holly Cummins - https://youtu.be/vnrXXvnqriA
  13. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) Holly Cummins - https://youtu.be/vnrXXvnqriA
  14. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows Holly Cummins - https://youtu.be/vnrXXvnqriA
  15. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows Holly Cummins - https://youtu.be/vnrXXvnqriA
  16. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows Holly Cummins - https://youtu.be/vnrXXvnqriA
  17. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows Holly Cummins - https://youtu.be/vnrXXvnqriA
  18. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows 🤘Continuous profiling & shaving Holly Cummins - https://youtu.be/vnrXXvnqriA
  19. @edeandrea What’s the Secret Sauce? 🤘Don’t be dynamic 🤘Dead code

    elimination / inlining 🤘Extensible build process so libraries can participate 🤘Jandex Indexing (offline reflection) 🤘Don’t make humans tell the computer what it knows 🤘Continuous profiling & shaving 🤘Be reactive without forcing humans to do reactive Holly Cummins - https://youtu.be/vnrXXvnqriA
  20. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  21. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  22. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  23. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  24. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  25. @edeandrea JVM Native Quarkus Spring Boot Ratio (Quarkus / SB)

    Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.13 7.6 172.95% 17.02 77.26% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.4 66.22% 71.22 205.74 34.62% Av. time to 1st req (ms) 4,652.67 8,770.33 53.05% 8,180.67 56.87% 135.67 916.67 14.8% Av. RSS after 1st req (MB) 244.61 339.52 72.05% 331.78 73.73% 79.12 208.21 38% Av. throughput (req/sec) 30,397.95 6,495.2 468.01% 6,427.64 472.93% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.5% 7.89 453.88% 59.82 15.94 375.27% Build RSS (GB) 5.62 7.99 70.34% Binary Size (MB) 90.95 157.04 57.92% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  26. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 39,668 classes

    ◦ 85,060 fields ◦ 282,912 methods ◦ Reflection: ◦ 11,151 classes ◦ 1,638 fields ◦ 13,050 methods A Real Example
  27. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 39,668 classes

    ◦ 85,060 fields ◦ 282,912 methods ◦ Reflection: ◦ 11,151 classes ◦ 1,638 fields ◦ 13,050 methods 🤘 Quarkus 3 application contents: ◦ 23,974 classes ◦ 47,662 fields ◦ 191,219 methods ◦ Reflection: ◦ 6,820 classes ◦ 205 fields ◦ 5,945 methods A Real Example
  28. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 39,668 classes

    ◦ 85,060 fields ◦ 282,912 methods ◦ Reflection: ◦ 11,151 classes ◦ 1,638 fields ◦ 13,050 methods 🤘 Quarkus 3 application contents: ◦ 23,974 classes ◦ 47,662 fields ◦ 191,219 methods ◦ Reflection: ◦ 6,820 classes ◦ 205 fields ◦ 5,945 methods 🤘 The Quarkus application has: ◦ 15,694 (40%) less classes ◦ 37,398 (44%) less fields ◦ 91,693 (32%) less methods ◦ 4,331 (39%) less classes using reflection ◦ 1,433 (87%) less fields using reflection ◦ 7,105 (54%) less methods using reflection A Real Example