| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The tests are written as JMH benchmarks. They can be developed and executed as usual in your IDE. However, they are not executed during regular build as unit tests when a mvn test is running. Instead, to execute the performance tests, one should build a jar file with one of the profiles mentioned below and run it.
To allow performance testing of different Hibernate Validator versions there are multiple profiles configured. Choosing a profile executes the tests against the specified Hibernate Validator or BVal version, respectively. The defined profiles are:
Some tips before you start:
The following command line will run all performance tests listed in the main method of TestRunner class:
mvn clean package -Dvalidator=hv-current java -jar target/hibernate-validator-performance-hv-current.jar
It will generate a set of reports from each test execution. Currently, all test results information are inside the following generated file:
target/jmh-results.json
List of available profilers:
| Profiler | Description |
|---|---|
| org.openjdk.jmh.profile.ClassloaderProfiler | Classloader profiling via standard MBeans |
| org.openjdk.jmh.profile.CompilerProfiler | JIT compiler profiling via standard MBeans |
| org.openjdk.jmh.profile.GCProfiler | GC profiling via standard MBeans |
| org.openjdk.jmh.profile.HotspotClassloadingProfiler | HotSpot ™ classloader profiling via implementation-specific MBeans |
| org.openjdk.jmh.profile.HotspotCompilationProfiler | HotSpot ™ JIT compiler profiling via implementation-specific MBeans |
| org.openjdk.jmh.profile.HotspotMemoryProfiler | HotSpot ™ memory manager (GC) profiling via implementation-specific MBeans |
| org.openjdk.jmh.profile.HotspotRuntimeProfiler | HotSpot ™ runtime profiling via implementation-specific MBeans |
| org.openjdk.jmh.profile.HotspotThreadProfiler | HotSpot ™ threading subsystem via implementation-specific MBeans |
| org.openjdk.jmh.profile.StackProfiler | Simple and naive Java stack profiler |
If you want to run one of those profilers - pass it as parameter when running a jar file. For example:
java -jar target/hibernate-validator-performance-hv-current.jar -prof org.openjdk.jmh.profile.StackProfiler
To run a specific benchmark:
java -jar target/hibernate-validator-performance-hv-current.jar CascadedValidation
mkdir reports
for impl in "bval-1.1.2" "hv-5.4" "hv-current"; do
mvn -Dvalidator=${impl} package ; java -jar target/hibernate-validator-performance-${impl}.jar -rff reports/${impl}-jmh-results.json
done
At the moment the following benchmarks are defined:
A simple bean with a random number of failing constraints gets initialized and validated. The test is once executed with a shared ValidatorFactory and once the factory is recreated on each invocation.
Simple bean with cascaded validation which gets executed over and over.
Validation of a bean containing a lot of beans to cascade to.
This test has a few more constraints than the previous one, allowing to test our hypothesis in more realistic situation.
A number of _TestEntity_s is created where each entity contains a property for each built-in constraint type and also a reference to another TestEntity. All constraints are evaluated by a single ConstraintValidator implementation which fails a specified percentage of the validations.
When adding new performance tests, note the sources structure of this module:
Hence, when a new test is added, consider adding it to the jakarta and javax directories depending on the tested functionality.
| Back | FazBrowse Home | New Git URL |