Happy to report back that I’m done implementing performance tests in TRUNK-6420.
It is a very simple setup. It’s enabled for openmrs-core 2.9.x and 3.0.x. It’s a suite of 3 tests.
In each test we run openmrs-core, openmrs-platform and openmrs-referencepplication-3-backend docker images and measure mean startup time of 3 runs. Prior to the 3 runs we do an unmeasured run to install the app, which we don’t include in the mean startup time.
For 2.9.x we run versions of images that have the openmrs-core 2.8.x war, which gives us a baseline startup time and compare them to versions of images with a war file from the current 2.9.x build. For 3.0.x we use openmrs-core 2.9.x as a baseline.
The tests report back the mean startup time and difference in seconds between versions. They are also designed to fail, if the difference exceeds a given time. We allow for 10s of difference between versions on top of that so that we don’t see failures caused by hardware glitches…
This is what tests report back:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.openmrs.StartupPerformanceIT
INFO - StartupPerformanceIT.compareStartupPerformance(192) |2025-12-08T11:24:39,795| openmrs/openmrs-platform:2.8.x started up in 30s, while openmrs/openmrs-platform:2.9.x started up in 36s with the latter starting slower by 5s
INFO - StartupPerformanceIT.compareStartupPerformance(192) |2025-12-08T11:28:06,754| openmrs/openmrs-core:2.8.x started up in 21s, while openmrs/openmrs-core:2.9.x started up in 24s with the latter starting slower by 2s
INFO - StartupPerformanceIT.compareStartupPerformance(192) |2025-12-08T11:36:14,612| openmrs/openmrs-reference-application-3-backend:3.6.x-no-demo started up in 51s, while openmrs/openmrs-reference-application-3-backend:3.6.x-no-demo started up in 54s with the latter starting slower by 3s
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1004 s -- in org.openmrs.StartupPerformanceIT
Taken from TRUNK-6420: Do not run performane test on old java versions · openmrs/openmrs-core@3844520 · GitHub
Performance tests do not run by default so if you want to try them locally you need to run:
mvn clean install -Pperformance-test -Pskip-default-test
If you want to test your own distro, you simply adjust the docker image used for testing.
Performance tests are run on GHA for master and 2.9.x branches. They do not run for PRs.
I also adjusted our GHA for master and 2.9.x to run unit test, integration-tests and performance-test in parallel jobs so they complete faster for all builds (including PRs).
We can now easily compare startup time improvements in 2.9.x versus 2.8.x.
We may decide to run these tests as part of the O3 build as well to be able to detect performance issues, if things change in O3 and not just openmrs-core. They are available in the dev variant image of openmrs-core so it should be easy to run them in other builds.