Skip to content

Commit bf68b6f

Browse files
Add the benchmarking module [ECR-2383] (#1007)
1 parent 483d381 commit bf68b6f

File tree

3 files changed

+156
-0
lines changed

3 files changed

+156
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Exonum Java Benchmarks
2+
3+
This module contains benchmarks of various Exonum Java components.
4+
5+
It is configured to use [Java Microbenchmark Harness][jmh-home] (JMH).
6+
7+
[jmh-home]: https://openjdk.java.net/projects/code-tools/jmh/
8+
9+
*This module is included in the project for easier prototyping and experimentation.
10+
It does* not *contain system-level benchmarks of Exonum services, which currently
11+
reside in an internal project:*
12+
[exonum/exonum-benchmarking](https://github.com/exonum/exonum-benchmarking)
13+
14+
Earlier internal micro-benchmarks are
15+
in [exonum/exonum-java-benchmarks](https://github.com/exonum/exonum-java-benchmarks)
16+
project.
17+
18+
## Usage
19+
20+
Build the `benchmarks.jar` (from [exonum-java-binding](..) directory):
21+
22+
```
23+
# Build the benchmarks and the modules it depends upon
24+
mvn package -pl benchmarks -am
25+
```
26+
27+
Get some help:
28+
29+
```
30+
java -jar benchmarks/target/benchmarks.jar -h
31+
```
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2014, Oracle America, Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
* Neither the name of Oracle nor the names of its contributors may be used
17+
to endorse or promote products derived from this software without
18+
specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30+
THE POSSIBILITY OF SUCH DAMAGE.
31+
-->
32+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33+
<modelVersion>4.0.0</modelVersion>
34+
35+
<parent>
36+
<groupId>com.exonum.binding</groupId>
37+
<artifactId>exonum-java-binding-parent</artifactId>
38+
<version>0.8.0-SNAPSHOT</version>
39+
</parent>
40+
41+
<artifactId>exonum-java-benchmarks</artifactId>
42+
<version>0.8.0-SNAPSHOT</version>
43+
<packaging>jar</packaging>
44+
45+
<name>Exonum Java: Benchmarks</name>
46+
<description>Micro-benchmarks of various Exonum Java components.</description>
47+
48+
<properties>
49+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
50+
<jmh.version>1.21</jmh.version>
51+
<!--
52+
Name of the benchmark Uber-JAR to generate.
53+
-->
54+
<uberjar.name>benchmarks</uberjar.name>
55+
</properties>
56+
57+
<dependencies>
58+
<dependency>
59+
<groupId>org.openjdk.jmh</groupId>
60+
<artifactId>jmh-core</artifactId>
61+
<version>${jmh.version}</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.openjdk.jmh</groupId>
65+
<artifactId>jmh-generator-annprocess</artifactId>
66+
<version>${jmh.version}</version>
67+
<scope>provided</scope>
68+
</dependency>
69+
</dependencies>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-compiler-plugin</artifactId>
76+
</plugin>
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-shade-plugin</artifactId>
80+
<version>3.2.1</version>
81+
<executions>
82+
<execution>
83+
<phase>package</phase>
84+
<goals>
85+
<goal>shade</goal>
86+
</goals>
87+
<configuration>
88+
<finalName>${uberjar.name}</finalName>
89+
<transformers>
90+
<transformer
91+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
92+
<mainClass>org.openjdk.jmh.Main</mainClass>
93+
</transformer>
94+
</transformers>
95+
<filters>
96+
<filter>
97+
<!--
98+
Shading signed JARs will fail without this.
99+
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
100+
-->
101+
<artifact>*:*</artifact>
102+
<excludes>
103+
<exclude>META-INF/*.SF</exclude>
104+
<exclude>META-INF/*.DSA</exclude>
105+
<exclude>META-INF/*.RSA</exclude>
106+
</excludes>
107+
</filter>
108+
</filters>
109+
</configuration>
110+
</execution>
111+
</executions>
112+
</plugin>
113+
114+
<!-- Skip the deployment of internal module as it is inherited from parent pom -->
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-deploy-plugin</artifactId>
118+
<configuration>
119+
<skip>true</skip>
120+
</configuration>
121+
</plugin>
122+
</plugins>
123+
</build>
124+
</project>

exonum-java-binding/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<module>testkit</module>
7272
<module>app</module>
7373
<module>integration-tests</module>
74+
<module>benchmarks</module>
7475
</modules>
7576

7677
<scm>

0 commit comments

Comments
 (0)