I3NW1E: Modify the default iteration, time and forks in the JMH of KAEProvider

This commit is contained in:
Noah 2021-06-09 16:40:30 +08:00 committed by dongbohe
parent f4f738ee9c
commit a026b50cc1
2 changed files with 55 additions and 2 deletions

View File

@ -0,0 +1,49 @@
diff --git a/jdk/test/micro/org/openeuler/bench/security/openssl/BenchmarkBase.java b/jdk/test/micro/org/openeuler/bench/security/openssl/BenchmarkBase.java
index f19c948a..9aef6dc6 100644
--- a/jdk/test/micro/org/openeuler/bench/security/openssl/BenchmarkBase.java
+++ b/jdk/test/micro/org/openeuler/bench/security/openssl/BenchmarkBase.java
@@ -45,11 +45,11 @@ import java.security.Security;
import java.util.Random;
import java.util.concurrent.TimeUnit;
-@BenchmarkMode(Mode.AverageTime)
-@OutputTimeUnit(TimeUnit.MICROSECONDS)
-@Warmup(iterations = 2, time = 2, timeUnit = TimeUnit.SECONDS)
-@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Fork(jvmArgsPrepend = {"-Xms100G", "-Xmx100G", "-XX:+AlwaysPreTouch"}, value = 1)
+@BenchmarkMode(Mode.Throughput)
+@OutputTimeUnit(TimeUnit.SECONDS)
+@Warmup(iterations = 3, time = 3, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 8, time = 2, timeUnit = TimeUnit.SECONDS)
+@Fork(jvmArgsPrepend = {"-Xms100G", "-Xmx100G", "-XX:+AlwaysPreTouch"}, value = 5)
@Threads(1)
@State(Scope.Thread)
public class BenchmarkBase {
diff --git a/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java b/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
index 65bb8bf8..b1739222 100644
--- a/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
+++ b/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
@@ -30,6 +30,7 @@ import org.openjdk.jmh.annotations.Setup;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Warmup;
+import java.security.KeyPair;
import java.security.KeyPairGenerator;
@Warmup(iterations = 10, time = 2, timeUnit = TimeUnit.SECONDS)
@@ -46,12 +47,12 @@ public class RSAKeyPairGeneratorBenchmark extends BenchmarkBase {
public void setUp() throws Exception {
setupProvider();
keyPairGenerator = createKeyPairGenerator();
+ keyPairGenerator.initialize(keySize);
}
@Benchmark
- public void generateKeyPair() throws Exception {
- keyPairGenerator.initialize(keySize);
- keyPairGenerator.generateKeyPair();
+ public KeyPair generateKeyPair() throws Exception {
+ return keyPairGenerator.generateKeyPair();
}
private KeyPairGenerator createKeyPairGenerator() throws Exception {

View File

@ -918,7 +918,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}.%{buildver}
Release: 8
Release: 9
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@ -1104,6 +1104,7 @@ Patch190: 8266929_huawei_add_oid_mapping_common_sig_types.patch
Patch191: 8264640.patch
Patch192: add_kae_implementation_add_default_conf_file.patch
Patch193: improve_algorithmConstraints_checkAlgorithm_performance.patch
Patch194: modify_the_default_iteration_time_and_forks_in_the_JMH_of_KAEProvider.patch
#############################################
#
@ -1556,7 +1557,7 @@ pushd %{top_level_dir_name}
%patch190 -p1
%patch191 -p1
%patch192 -p1
%patch193 -p1
%patch194 -p1
popd
@ -2174,6 +2175,9 @@ require "copy_jdk_configs.lua"
%endif
%changelog
* Wed Jun 9 2021 noah <hedongbo@huawei.com> - 1:1.8.0.292-b10.9
- add modify_the_default_iteration_time_and_forks_in_the_JMH_of_KAEProvider.patch
* Tue Jun 8 2021 noah <hedongbo@huawei.com> - 1:1.8.0.292-b10.8
- fix kae exception compatibility