Skip to content

Commit 6b10930

Browse files
author
Ferdinand Xu
committed
Add script to support multi-JDK
1 parent fc08f3b commit 6b10930

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ dist/
3333
unit-tests.log
3434
/lib/
3535
dependency-reduced-pom.xml
36+
conf/benchmark.properties

sbin/run-benchmark.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
#!/bin/bash
18+
set -x
19+
if [ "$#" -ne 2 ];then
20+
echo "Usage: sh run-benchmark.sh path/to/JDKwithoutAESNIsupport path/to/JDKwithAESNIsupport \n JDK7u45 or higher supports AES-NI."
21+
exit 1
22+
fi
23+
echo "This benchmark will evaluate the performance of Chimera in different transfomations, ciphers and JDK versions"
24+
25+
if [ ! -f "conf/benchmark.properties" ];then
26+
echo "Not able to find the benchmark.propety, will use default propety instead"
27+
cp conf/benchmark.properties.template conf/benchmark.properties
28+
fi
29+
30+
CRYPTO_JAR=`find . -name commons-crypto*.jar`
31+
32+
echo "Using JDK in path $1 to evalue the performance"
33+
$1/bin/java -Djava.library.path="$PATH" -cp $CRYPTO_JAR:target/test-classes org.apache.commons.crypto.benchmark.CommonsCryptoBenchmark conf/benchmark.properties
34+
echo "Using JDK in path $2 to evaluate the performance"
35+
$2/bin/java -Djava.library.path="$PATH" -cp $CRYPTO_JAR:target/test-classes org.apache.commons.crypto.benchmark.CommonsCryptoBenchmark conf/benchmark.properties

src/test/java/org/apache/commons/crypto/benchmark/CommonsCryptoBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void main(String[] args) throws IOException {
3333

3434
if (args != null && args.length != 0 && args.length != 1 && args.length != 4) {
3535
System.out.println(
36-
"Usage: java -Djava.library.path=\"$PATH\" -cp commons-crypto-[version].jar:path/to//target/test-classes/ org.apache.commons.crypto.CommonsCryptoBenchmark [warmupIterations] [iterations] [dataSize] [operationSize] or java -Djava.library.path=\"$PATH\" -cp commons-crypto-[version].jar:path/to/Chimera/target/test-classes/ org.apache.commons.crypto.CommonsCryptoBenchmark [path/to/configuration]");
36+
"Usage: java -Djava.library.path=\"$PATH\" -cp path/to/commons-crypto-[version].jar:path/to/target/test-classes/ org.apache.commons.crypto.benchmark.CommonsCryptoBenchmark [warmupIterations] [iterations] [dataSize] [operationSize] or java -Djava.library.path=\"$PATH\" -cp commons-crypto-[version].jar:path/to/Chimera/target/test-classes/ org.apache.commons.crypto.benchmark.CommonsCryptoBenchmark [path/to/configuration]");
3737
System.out.println("args[0]: " + args[0]);
3838
System.exit(1);
3939
}

0 commit comments

Comments
 (0)