This tool is used to benchmark the DevCycle Java Server SDK and is built using the Java Microbenchmark Harness (JMH).
This tool works with Java 8 and above but will require a x86_64 JDK.
Currently Supported Platforms are:
| OS | Arch |
|---|---|
| Linux (ELF) | x86_64 |
| Mac OS | x86_64 |
| Windows | x86_64 |
In addition the benchmark tool requires Maven to be installed.
The benchmark itself is defined in SDKBenchmark.java. It is configured to test a single boolean variable evaluation repeatedly based on the config defined in resources/fixture_large_config.json
A local web server (see MockServer.java) is created to replicate DevCycle config and event services and support the SDK client.
You can run the benchmark tool by executing the following commands:
mvn clean install
java -jar target/java-server-sdk-benchmarks.jarJMH builds an executable jar designed to run the benchmark as optimally as possible.
The Java Server SDK is defined in the pom.xml file as a dependency. To target a specific version of the SDK, update the pom.xml file to reference the desired version.
<dependency>
<groupId>com.devcycle</groupId>
<artifactId>java-server-sdk</artifactId>
<version>1.4.0</version>
<scope>compile</scope>
</dependency>If you want to target an ad hoc version, generate a JAR file for the java-server-sdk in the parent project by running the following command:
gradle jarThen update the benchmark/pom.xml to point to that JAR file but adding a systemPath element to the dependency and changing the scope to system:
<dependency>
<groupId>com.devcycle</groupId>
<artifactId>java-server-sdk</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../build/libs/java-server-sdk-1.4.0.jar</systemPath>
</dependency>VariableTest.java is a simple test that can be used to profile the SDK. It utilizes the same structure and data as the benchmark, but without the JMH complexity.
Just execute the
To work on the benchmark tool, it is recommended that you open up the benchmark directory as its own project folder in your IDE. This will allow you to run the tool directly from your IDE.