Last change
on this file was
1a49309,
checked in by str4d <str4d@…>, 4 years ago
|
Add usage info to benchmark script
|
-
Property mode set to
100755
|
File size:
1.4 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | # |
---|
4 | # Benchmark runner |
---|
5 | # |
---|
6 | # Usage: benchmark.sh [--jbigi] [JMH_ARGS] |
---|
7 | # |
---|
8 | # To use: |
---|
9 | # 1) Set jmh.home in override.properties to a folder containing: |
---|
10 | # - jmh-core.jar |
---|
11 | # - jmh-generator-annprocess.jar |
---|
12 | # - jopt-simple.jar |
---|
13 | # - commons-math3.jar |
---|
14 | # Fetch these from Maven Central. Tested using JMH 1.19 which requires |
---|
15 | # jopt-simple 4.6 and commons-math3 3.2. |
---|
16 | # 2) Compile the benchmarks with "ant bench". |
---|
17 | # 3) Run the benchmarks: |
---|
18 | # - To see underlying JMH options: |
---|
19 | # - ./benchmark.sh -h |
---|
20 | # - To run the benchmarks in pure-Java mode: |
---|
21 | # - ./benchmark.sh |
---|
22 | # - To run the benchmarks with jbigi.jar in the classpath: |
---|
23 | # - ./benchmark.sh --jbigi |
---|
24 | # - To run the benchmarks with a different JVM: |
---|
25 | # - JAVA=/path/to/java ./benchmarks/benchmark.sh |
---|
26 | # |
---|
27 | |
---|
28 | CWD=$(dirname "$0") |
---|
29 | if [ "x$JAVA" = 'x' ] |
---|
30 | then |
---|
31 | JAVA=java |
---|
32 | fi |
---|
33 | |
---|
34 | if [ "x$BENCHMARKS" = 'x' ] |
---|
35 | then |
---|
36 | BENCHMARKS="$CWD/i2p-benchmarks.jar" |
---|
37 | stat "$BENCHMARKS" >/dev/null 2>&1 |
---|
38 | if [ "x$?" != 'x0' ] |
---|
39 | then |
---|
40 | BENCHMARKS="$CWD/../../core/java/build/i2p-benchmarks.jar" |
---|
41 | fi |
---|
42 | fi |
---|
43 | |
---|
44 | if [ "x$JBIGI" = 'x' ] |
---|
45 | then |
---|
46 | JBIGI="$CWD/jbigi.jar" |
---|
47 | stat "$JBIGI" >/dev/null 2>&1 |
---|
48 | if [ "x$?" != 'x0' ] |
---|
49 | then |
---|
50 | JBIGI="$CWD/../../build/jbigi.jar" |
---|
51 | fi |
---|
52 | fi |
---|
53 | |
---|
54 | CLASSPATH="$BENCHMARKS" |
---|
55 | if [ "x${1:-}" = 'x--jbigi' ] |
---|
56 | then |
---|
57 | CLASSPATH="$CLASSPATH:$JBIGI" |
---|
58 | shift |
---|
59 | fi |
---|
60 | |
---|
61 | $JAVA -cp "$CLASSPATH" org.openjdk.jmh.Main "$@" |
---|
Note: See
TracBrowser
for help on using the repository browser.