diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index b7d95b17..d0165f68 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -138,6 +138,37 @@ Upgrading to 2.7 is *not allowed*. ** During the milestone phase of a new release train, upgrade to the latest version of a dependency unless compatibility with a former version is required. Upgrades to new major versions are allowed, too, but consider ways to support multiple major versions for one release train to allow a smoother transition. +[[advanced.benchmarks]] +=== Benchmarks + +We use JMH for micro-benchmarks. + +Our benchmarks are located in the `src/jmh/java` directory so that we compile these as part of our main build. To run benchmarks during development we leverage JUnit 5 and the https://github.com/mp911de/microbenchmark-runner[Microbenchmark Runner]. +Enable the `jmh` Maven Profile, add `@Testable` to the benchmark you want to run (of the benchmark class) and run it as it was a JUnit test right from your IDE. + +NOTE: Microbenchmark Runner is not a tool for running final benchmarks, rather it helps to quickly run benchmarks during development to reduce turnaround time. + +Benchmarks aren't ran during the build. + +JMH's Benchmark Generator (Annotation Processor) must be enabled in each module with the Maven Compiler, see the following example: + +[source,xml] +---- + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh} + + + + +---- + [[advanced.change-tracking]] === Change tracking @@ -192,7 +223,7 @@ Make sure you keep the original author when amending. curl $PULL_REQUEST_URL.patch | git am --ignore-whitespace ---- -* If the you merge back a feature branch and multiple developers contributed to that, try to rearrange to commits and squash the into a single commit per developer. +* If you merge back a feature branch and multiple developers contributed to that, try to rearrange to commits and squash the into a single commit per developer. Combine the commit messages and edit them to make sense. * Before pushing the changes to the remote repository, amend the commit(s) to be pushed and add a reference to the pull request to them. This will cause the pull request UI in GitHub show and link those commits. @@ -201,5 +232,5 @@ This will cause the pull request UI in GitHub show and link those commits. ---- … -Original pull request #?? +Original pull request: #?? ---- diff --git a/parent/pom.xml b/parent/pom.xml index 7053b36a..23df0514 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -112,6 +112,7 @@ 0.8.12 1.9.0 0.21.0 + 1.37 2.6.0 4.13.2 @@ -936,6 +937,24 @@ + + jmh + + + com.github.mp911de.microbenchmark-runner + microbenchmark-runner-junit5 + 0.4.0.RELEASE + test + + + + + jitpack.io + https://jitpack.io + + + + @@ -1025,6 +1044,12 @@ ${webbeans} test + + org.openjdk.jmh + jmh-generator-annprocess + test + ${jmh} + @@ -1043,6 +1068,14 @@ test + + + org.openjdk.jmh + jmh-core + test + ${jmh} + + org.mockito mockito-core @@ -1287,6 +1320,19 @@ + + jmh-compile + test-compile + + test-compile + + + + ${project.basedir}/src/jmh/kotlin + ${project.basedir}/src/jmh/java + + + @@ -1377,6 +1423,18 @@ org.codehaus.mojo build-helper-maven-plugin + + add-jmh-source + generate-test-sources + + add-test-source + + + + ${project.basedir}/src/jmh/java + + + add-kotlin-source prepare-package diff --git a/pom.xml b/pom.xml index 120649fc..9d452f45 100644 --- a/pom.xml +++ b/pom.xml @@ -100,8 +100,6 @@ - - org.apache.maven.plugins maven-enforcer-plugin