From 6c13dc03ecf27197d2fe9f28749005642b7be637 Mon Sep 17 00:00:00 2001 From: sendaoYan Date: Thu, 19 Dec 2024 17:10:43 +0800 Subject: [PATCH] [Misc] Support jmh tests Summary: Support jmh tests Testing: CI pipeline Reviewers: Accelerator1996, ziyilin Issue: https://github.com/dragonwell-project/dragonwell11/issues/898 --- test/jmh-tests/pom.xml | 161 ++++++++++++++++++ test/jmh-tests/src/main/java | 1 + .../bench/java/security/CacheBench.java | 4 +- 3 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 test/jmh-tests/pom.xml create mode 120000 test/jmh-tests/src/main/java diff --git a/test/jmh-tests/pom.xml b/test/jmh-tests/pom.xml new file mode 100644 index 00000000000..3074a17dd07 --- /dev/null +++ b/test/jmh-tests/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + + org.sample + test + 1.0 + jar + + Auto-generated JMH benchmark + + + 3.0 + + + + + org.openjdk.jmh + jmh-core + ${jmh.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + provided + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + + UTF-8 + 1.0 + 11 + benchmarks + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + ${javac.target} + ${javac.target} + ${javac.target} + + --add-exports + java.base/sun.security.util=ALL-UNNAMED + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.2 + + + package + + shade + + + ${uberjar.name} + + + org.openjdk.jmh.Main + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + maven-clean-plugin + 2.5 + + + maven-deploy-plugin + 2.8.1 + + + maven-install-plugin + 2.5.1 + + + maven-jar-plugin + 2.4 + + + maven-javadoc-plugin + 2.9.1 + + + maven-resources-plugin + 2.6 + + + maven-site-plugin + 3.3 + + + maven-source-plugin + 2.2.1 + + + maven-surefire-plugin + 2.17 + + + + + + diff --git a/test/jmh-tests/src/main/java b/test/jmh-tests/src/main/java new file mode 120000 index 00000000000..5aab00962e7 --- /dev/null +++ b/test/jmh-tests/src/main/java @@ -0,0 +1 @@ +../../../micro \ No newline at end of file diff --git a/test/micro/org/openjdk/bench/java/security/CacheBench.java b/test/micro/org/openjdk/bench/java/security/CacheBench.java index a7fe33432f7..1efadafed74 100644 --- a/test/micro/org/openjdk/bench/java/security/CacheBench.java +++ b/test/micro/org/openjdk/bench/java/security/CacheBench.java @@ -44,7 +44,7 @@ @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(jvmArgsAppend = {"--add-exports", "java.base/sun.security.util=ALL-UNNAMED", "-Xmx1g"}) public class CacheBench { - +/* @State(Scope.Benchmark) public static class SharedState { Cache cache; @@ -124,5 +124,5 @@ public void tearDown() { public void remove(SharedState benchState, RemoveState state) { Integer i = state.intArray[state.index]; benchState.cache.remove(i); - } + }*/ }