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

7-15-24 - Quarkus Club - Quarkus for Spring Dev...

7-15-24 - Quarkus Club - Quarkus for Spring Developers

Are you a Spring developer and interested in learning something new? 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, including how testing is done. Additionally, I will highlight performance characteristics between them and prove, live, that you could save 50% in your operational costs and reduce your carbon emissions 2-3x simply by switching your Java runtime.

Eric Deandrea

July 15, 2024
Tweet

More Decks by Eric Deandrea

Other Decks in Technology

Transcript

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

    software development experience Java Champion 🤘 Contributor to Open Source projects Quarkus Spring Boot, Spring Framework, Spring Security LangChain4j (& Quarkus LangChain4j) Wiremock Microcks 🤘 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 Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native

    Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse
  4. @edeandrea Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native

    Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse
  5. @edeandrea Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native

    Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse
  6. @edeandrea Java / Jakarta EE J2SE / J2EE Monolith Cloud-Native

    Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse
  7. @edeandrea Java / Jakarta EE J2SE / J2EE Monolith Cloud-Native

    Microservices Serverless Event-Driven Microservices Cloud-Native Spring Boot MicroProfile Java, The Enterprise Workhorse
  8. @edeandrea The Warmup Issue with Java Simon Ritter - Azul

    Systems - https://youtu.be/bWmuqh6wHgE (first 13 minutes)
  9. @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?
  10. @edeandrea JVM Build Time @ @ </> Package model Native

    The Quarkus Way enables Native Compilation
  11. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  12. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  13. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  14. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  15. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  16. @edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework

    version 3.12.1 3.3.1 Build time (s) 8.95 5.27 169.72% Av. RSS after startup (MB) 195.94 319.45 61.34% Av. time to 1st req (ms) 2,566 6,287 40.81% Av. RSS after 1st req (MB) 247.94 324.35 76.44% Av. throughput (req/sec) 31,753.08 7,886.45 402.63% Max throughput density (req/sec/MB) 58.27 13.62 427.98% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.12.1 3.3.1 Build time (s) 123.62 206.84 59.76% Av. RSS after startup (MB) 71.06 192.3 36.95% Av. time to 1st req (ms) 106.33 469.33 22.66% Av. RSS after 1st req (MB) 78.36 194.7 40.25% Av. throughput (req/sec) 18,022.79 6,729.3 267.83% Max throughput density (req/sec/MB) 69.6 17.5 397.81% Don’t Take My Word For It! Some real numbers (8 cores, 14GB RAM, GraalVM CE 21.0.2)
  17. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 38,673 classes

    ◦ 83,377 fields ◦ 276,625 methods ◦ Reflection: ◦ 10,960 classes ◦ 1,019 fields ◦ 12,853 methods A Real Example
  18. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 38,673 classes

    ◦ 83,377 fields ◦ 276,625 methods ◦ Reflection: ◦ 10,960 classes ◦ 1,019 fields ◦ 12,853 methods 🤘 Quarkus 3 application contents: ◦ 23,584 classes ◦ 47,091 fields ◦ 187,261 methods ◦ Reflection: ◦ 6,608 classes ◦ 192 fields ◦ 4,754 methods A Real Example
  19. @edeandrea 🤘 Spring Boot 3 application contents: ◦ 38,673 classes

    ◦ 83,377 fields ◦ 276,625 methods ◦ Reflection: ◦ 10,960 classes ◦ 1,019 fields ◦ 12,853 methods 🤘 Quarkus 3 application contents: ◦ 23,584 classes ◦ 47,091 fields ◦ 187,261 methods ◦ Reflection: ◦ 6,608 classes ◦ 192 fields ◦ 4,754 methods 🤘 The Quarkus application has: ◦ 15,089 (39%) less classes ◦ 36,286 (44%) less fields ◦ 89,364 (32%) less methods ◦ 4,352 (40%) less classes using reflection ◦ 827 (81%) less fields using reflection ◦ 8,099 (63%) less methods using reflection A Real Example