Gunnar Morling is a software engineer and open-source enthusiast by heart. He is leading the Debezium project, a platform for change data capture (CDC). He is a Java Champion, the spec lead for Bean Validation 2.0 (JSR 380) and has founded multiple open source projects such as Deptective and MapStruct. Prior to joining Red Hat, Gunnar worked on a wide range of Java EE projects in the logistics and retail industries. He's based in Hamburg, Germany.
Powerful Google developer tools for immediate impact! (2023-24 C)
Continuous Performance Regression Testing with JfrUnit
1. Brought to you by
Continuous Performance
Regression Testing with JfrUnit
Gunnar Morling
Principal Software Engineer at
2. Today’s Objective: Learn About...
■ Implementing performance regression tests with JDK Flight Recorder
and JfrUnit
■ Analyzing performance regressions in JDK Mission Control
■ Emitting JFR events from 3rd party libraries
3. Gunnar Morling
Principal Software Engineer at Red Hat
■ Debezium
■ Quarkus
■ JfrUnit, ModiTect, kcctl
■ Spec Lead for Bean Validation 2.0
■ Java Champion
■ @gunnarmorling
4. Challenges of Performance Tests
■ Tests based on throughput or latency are dependent on specifics of the
environment
● Require production-like set-up
● Impacted by unrelated concurrent load (e.g. on CI server)
5. JfrUnit — Assert Performance Impacting Metrics
■ Assert proxy metrics like memory allocation or IO
● Based on JDK Flight
Recorder events
● Failures may indicate a
performance regression
■ Plain unit tests
■ Analyse in JDK Mission Control
12. JfrUnit — Discussion and Limitations
■ Robust tests with very fast feedback cycle
● Independent from environment
● Proactive identification of issues
■ Metrics need solid understanding; e.g. increased allocation may or may not
be a problem
■ Cannot identify all issues, e.g. locks showing up only under load
■ Won’t help with issues elsewhere, e.g. a bad query execution plan
14. Take Aways
■ JfrUnit: a tool in the performance testing box
● Complement - no replacement - for other tests
■ JMC Agent: produce events from code not under your control
■ Move beyond Java 1.8 🚀
15. Outlook — Keeping Track of Historic Values
https://horreum.hyperfoil.io/
16. Resources
■ JfrUnit
https://github.com/moditect/jfrunit
■ Introduction to JfrUnit
https://www.morling.dev/blog/towards-continuous-performance-regression-t
esting/
■ Introduction to JMC Agent
https://developers.redhat.com/blog/2020/10/29/collect-jdk-flight-recorder-ev
ents-at-runtime-with-jmc-agent/
■ Profiling Java inside containers with ContainerJFR
https://developers.redhat.com/devnation/tech-talks/containerjfr
17. Brought to you by
Gunnar Morling
gunnar@hibernate.org
@gunnarmorling