https://github.com/joel-jeremy/java-config-library-benchmarks
Benchmark of Java configuration libraries
https://github.com/joel-jeremy/java-config-library-benchmarks
benchmark configuration java properties
Last synced: 4 months ago
JSON representation
Benchmark of Java configuration libraries
- Host: GitHub
- URL: https://github.com/joel-jeremy/java-config-library-benchmarks
- Owner: joel-jeremy
- License: mit
- Created: 2022-06-13T11:10:32.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2026-01-20T22:57:51.000Z (6 months ago)
- Last Synced: 2026-01-21T07:07:12.451Z (6 months ago)
- Topics: benchmark, configuration, java, properties
- Language: Java
- Homepage:
- Size: 1.4 MB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Benchmarks Results
Each push to the repository will trigger a benchmark run. The project uses a special build task which merges all the benchmark results into a single report file. Latest benchmark results will be viewable via GitHub Pages: [https://joel-jeremy.github.io/java-config-library-benchmarks/](https://joel-jeremy.github.io/java-config-library-benchmarks/)
## Libraries
(Alphabetical order)
- [Cfg4j](https://github.com/cfg4j/cfg4j)
- [Externalized Properties](https://github.com/joel-jeremy/externalized-properties)
- [Gestalt Config](https://github.com/gestalt-config/gestalt)
- [Lightbend Config](https://github.com/lightbend/config)
- [MicroProfile Config - Geronimo](https://github.com/apache/geronimo-config)
- [MicroProfile Config - Helidon](https://github.com/oracle/helidon)
- [MicroProfile Config - KumuluzEE](https://github.com/kumuluz/kumuluzee-config-mp)
- [MicroProfile Config - MicroBean](https://github.com/microbean/microbean-microprofile-config)
- [MicroProfile Config - SmallRye](https://github.com/smallrye/smallrye-config)
- [Owner](https://github.com/matteobaccan/owner)
- [Spring Core](https://github.com/spring-projects/spring-framework) (Directly using Spring's [Environment](https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/core/env/Environment.java))
## Benchmark Setup
Each library is setup with its "default" configurations. In addition to the defaults, additional configuration/setup is done to "load" a single `.properties` file. For the benchmark runs, each library will load properties/configuration from the loaded `.properties` file (all with exactly the same file contents).
## Benchmark Run
Benchmarks require Java 25.
To run the benchmarks and generate reports locally, use the `runAllJmh.sh` script.
## Adding New Benchmarks
To introduce a new benchmark, create a new gradle subproject and:
1. Create an `Benchmark` abstract class under `io.github.joeljeremy7.java.config.lib.benchmarks` package.
2. Create benchmark methods in `Benchmark` class
- Minimum required methods are:
1. Retrieve a `String` property/configuration
2. Retrieve an `int` property/configuration
3. Create an `Avgt` and `Thrpt` nested class within `Benchmark` which extends the abstract `Benchmark` class so that they execute the same benchmarks.
4. Annotate `Avgt` and `Thrpt` nested classes with appropriate JMH annotations to record results: avgt (ns) and thrpt (ms).
5. Add the subproject's `jmh` task to the `runAllJmh.sh` script.
6. Add the subproject's folder name to the `benchmarks.yaml` GitHub Actions workflow:
```yaml
jmh:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
module:
- ...
- my-config-library
```
7. Add project repository link to [Libraries](#libraries) section.