This project provides focused JMH benchmarks to test Spring Framework property resolution performance between versions 6.1 and 6.2, specifically designed to reproduce performance regressions in property placeholder resolution.
property-resolution-benchmark/
├── pom.xml # Maven configuration with Spring 6.1/6.2 profiles
├── run-benchmarks.sh # Automated benchmark execution script
├── README.md # This file
└── src/main/java/perf/spring/benchmark/
└── SpringPropertyResolutionBenchmark.java # Property resolution benchmarks
- Java 17+
- Maven 3.6+
./run-benchmarks.sh./run-benchmarks.sh 5000 # 5K properties
./run-benchmarks.sh 20000 # 20K properties
./run-benchmarks.sh 50000 # 50K properties# Test Spring 6.1
mvn clean package -Pspring-6.1
java -jar target/property-resolution-benchmark.jar -p propertyCount=10000
# Test Spring 6.2
mvn clean package -Pspring-6.2
java -jar target/property-resolution-benchmark.jar -p propertyCount=10000- Simple Property Resolution: Basic property value retrieval
- Nested Property Resolution: Properties with placeholder references
- Complex Property Resolution: Multi-level nested properties
- Property Placeholder Helper: Direct placeholder resolution using Spring's PropertyPlaceholderHelper
- Batch Property Resolution: Multiple property resolution in sequence
The propertyCount parameter controls the number of properties used in benchmarks:
- Default: 10,000 properties
- Range: 5,000 - 50,000 properties
- Configurable via command line or script parameter
- Heap: 2GB - 4GB
- Forks: 3 (for statistical significance)
- Warmup: 3 iterations, 2 seconds each
- Measurement: 5 iterations, 3 seconds each
Benchmark results are saved to:
benchmark-results/results-spring-6.1-{propertyCount}properties.txtbenchmark-results/results-spring-6.2-{propertyCount}properties.txtbenchmark-results/jmh-spring-6.1-{propertyCount}properties.jsonbenchmark-results/jmh-spring-6.2-{propertyCount}properties.jsonbenchmark-results/performance-comparison-{propertyCount}properties.txt
This benchmark suite is specifically designed to identify performance regressions in Spring Framework 6.2 property resolution, particularly:
- Property Placeholder Resolution: Tests the new PlaceholderParser implementation
- Nested Property Resolution: Measures performance with complex property dependencies
- Circular Property Resolution: Tests circular reference handling
- Batch Property Resolution: Measures performance with multiple property lookups
This project can be used as a reproducer for Spring Framework property resolution performance regression bug reports by:
- Running benchmarks with both Spring 6.1 and 6.2
- Comparing results to identify regressions
- Providing detailed performance metrics and JVM settings
- Demonstrating the impact on different property counts and scenarios