JPerfEvo is a comprehensive framework designed to analyze Java project performance over time by mining commit history, identifying relevant changes, and benchmarking them using JMH (Java Microbenchmark Harness). The tool offers insights into performance evolution and enables statistical significance testing of performance changes.
- Clone and analyze Java project repositories.
- Mine project changes and identify benchmark dependencies.
- Select candidate commits for benchmarking.
- Execute benchmarks using JMH.
- Analyze performance results for statistical significance.
- Optional integrations for kernel tracing, LLM services, email notifications, and database storage.
- Python 3.x
- Java Development Kit (JDK 8 or later)
- Git
- Docker and Docker Compose
- Additional Python dependencies (install via
requirements.txt
)
- Clone the JPerfEvo repository:
git clone https://github.com/kavehshahedi/java-performance-history-buddy cd java-performance-history-buddy
- Install Python dependencies:
pip install -r requirements.txt
- Ensure Java, Git, Docker, and Docker Compose are installed and configured on your system.
The primary entry point is main.py
. Use the following command to analyze a project:
python3 main.py \
--name <project_name> \
--git <git_url> \
--package <package_name> \
[optional arguments]
--name
: Name of the project to analyze.--git
: Git URL of the project repository.--package
: Target Java package for analysis.
--benchmark-module
: Specify a custom benchmark module.--custom-commits
: File path containing custom commit hashes (one per line).--forks
: Number of forks for JMH benchmarking (default: 3).--warmups
: Number of warmup iterations (default: 0).--iterations
: Number of measurement iterations (default: 5).--measurement-time
: Time per iteration in seconds (default: 10s).--max-instrumentations
: Max instrumentations per method (default: 100,000).--kernel
: Enable kernel tracing using LTTng.--llm
: Enable LLM-based analysis.--email
: Enable email notifications.--use-db
: Use MongoDB for data storage.--cloud-db
: Use MongoDB Atlas for cloud storage.
python3 main.py \
--name SampleProject \
--git https://github.com/sample/repository.git \
--package com.sample.project \
--benchmark-module benchmarks \
--forks 5 \
--iterations 10
JPerfEvo includes Docker support for consistent and portable execution across platforms.
To build the Docker image for JPerfEvo, use the following commands. These commands ensure compatibility across platforms (e.g., Linux and Windows):
# Build the image for the current platform
docker build -t jphb:latest .
# For multi-platform support (e.g., Linux amd64 and Windows x86/x64):
docker buildx create --use
docker buildx build --platform linux/amd64,windows/amd64 -t jphb:latest . --push
Use docker-compose.yml
for managing the container:
docker-compose up -d
This will start the container with the following features:
- Exposes port
80
for accessing results. - Mounts volumes for results and project data.
- Supports configurable runtime commands through the
PROGRAM
environment variable.
In the docker-compose.yml
file:
services:
jphb:
image: jphb:latest
container_name: jphb-container
ports:
- "80:80"
volumes:
- jphb_data:/app/results
- jphb_projects:/app/projects
environment:
- PROGRAM=python main.py --name ExampleProject --git https://github.com/example/repo.git --package com.example.project
- Clone Repository: Clones the specified Git repository and validates it.
- Mine Changes:
- Identifies relevant commits with method changes.
- Detects benchmark dependencies.
- Select Candidate Commits:
- Identifies commits suitable for benchmarking based on method changes and buildability.
- Benchmark Execution:
- Runs JMH benchmarks on candidate commits.
- Collects execution time and traces for analysis.
- Performance Analysis:
- Compares results between commits using statistical significance tests (e.g., Mann-Whitney U, Cliff’s Delta).
- Identifies performance regressions or improvements.
The tool generates the following outputs:
- Benchmark execution results and statistical significance reports.
- Candidate commit details and mined method changes.
- Trace data and analysis summaries.
- Kernel Tracing: Enable tracing of system calls and interrupts using LTTng.
- LLM Services: Use AI to validate and enhance method changes.
- Email Notifications: Notify users of pipeline results via email.
- Database Support: Store results in MongoDB for further analysis.
This project is licensed under the MIT License. See LICENSE
for more details.