Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions esdk-performance-testing/benchmarks/java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AWS Encryption SDK Java Benchmark

Performance testing suite for the AWS Encryption SDK Java implementation.

## Quick Start

```bash
# Build the project
mvn clean compile

# Run benchmark
mvn exec:java -Dexec.mainClass="com.amazon.esdk.benchmark.Program"

# Quick test (reduced iterations)
mvn exec:java -Dexec.mainClass="com.amazon.esdk.benchmark.Program" -Dexec.args="--quick"
```

## Options

- `--config` - Path to test configuration file (default: `../../config/test-scenarios.yaml`)
- `--output` - Path to output results file (default: `../../results/raw-data/java_results.json`)
- `--quick` - Run with reduced iterations for faster testing

## Configuration

Edit `../../config/test-scenarios.yaml` for test parameters:

- Data sizes (small/medium/large)
- Iterations and concurrency levels

## Test Types

- **Throughput** - Measures encryption/decryption operations per second
- **Memory** - Tracks memory usage and allocations during operations
- **Concurrency** - Tests performance under concurrent load

## Output

Results saved as JSON to `../../results/raw-data/java_results.json` with:

- Performance metrics (ops/sec, latency percentiles)
- Memory usage (peak, average, allocations, input data to memory ratio)
- System information (CPU, memory, Java version)
120 changes: 120 additions & 0 deletions esdk-performance-testing/benchmarks/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>com.amazon.esdk</groupId>
<artifactId>esdk-performance-benchmark</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- AWS Encryption SDK -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-encryption-sdk-java</artifactId>
<version>3.0.2</version>
</dependency>

<!-- AWS Cryptographic Material Providers Library -->
<dependency>
<groupId>software.amazon.cryptography</groupId>
<artifactId>aws-cryptographic-material-providers</artifactId>
<version>1.11.0</version>
</dependency>

<!-- Jackson for YAML processing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.15.2</version>
</dependency>

<!-- Progress bar -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: I love a progress bar for any long running job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun fact: I had to spend the same amount of time on progress bar as much as I spent on memory sampling! Cause multi-threading, sys out i/o, and progress bar don't play nicely. So the love is mutual haha!

<dependency>
<groupId>me.tongfei</groupId>
<artifactId>progressbar</artifactId>
<version>0.9.5</version>
</dependency>

<!-- SLF4J for logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.amazon.esdk.benchmark.Program</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>com.amazon.esdk.benchmark.Program</mainClass>
</configuration>
</plugin>

<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.40.0</version>
<configuration>
<java>
<googleJavaFormat />
</java>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading
Loading