Repository navigation
Conversation
ScenarioBenchmark runs each scenario against both providers, selected by a JMH parameter, and checks the expected violation counts once per trial: mixed valid/invalid beans, explicit groups, validateProperty/Value, parameter and return value validation, cascading into large collections and cycles, container element constraints, deep graphs, beans with many built-in constraints (valid and fully invalid), composed and class-level constraints, and EL message expressions. Also run the JMH annotation processor explicitly, as JDK 23+ no longer does so implicitly, and register Tomcat's ExpressionFactory ahead of the bval-jsr test fixture that re-resolves its delegate on every call. Both benchmark classes default to 2 forks of 3 warmup and 5 measurement iterations of 1 s, so that a plain run takes minutes rather than hours.
Member
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a scenario benchmark that runs the same validations against BVal and Hibernate Validator. The PRs stacked on top of this one quote their numbers against it.
bval-perf/ ├── pom.xml # + <proc>full</proc>: JDK 23+ no longer runs the JMH processor implicitly └── src/test/ ├── java/org/apache/bval/jsr/ │ ├── Jsr303Benchmark.java # + default 2 forks × (3 warmup + 5 measurement) × 1 s + │ └── ScenarioBenchmark.java # 18 scenarios × -p provider=bval|hibernate + └── resources/META-INF/services/ + └── jakarta.el.ExpressionFactory # Tomcat EL ahead of the bval-jsr test fixtureEvidence
After:
java -cp <bval-perf test classpath> org.openjdk.jmh.Main ScenarioBenchmark -p provider=bvaltakes about 5 minutes and gives this baseline:Baseline (master + this PR)
Merge Danger
Door: two-way
Blast Radius: none
Test-scope only:
bval-perfsources and its build; nothing ships.