https://github.com/fadouse/jvmbenchmark
JVMBenchmark evaluates the performance impact of code obfuscation on Java applications using JVM 17 and JDK 17. It helps developers balance security with potential performance trade-offs.
https://github.com/fadouse/jvmbenchmark
benchmark java jvm performace-testing
Last synced: about 1 year ago
JSON representation
JVMBenchmark evaluates the performance impact of code obfuscation on Java applications using JVM 17 and JDK 17. It helps developers balance security with potential performance trade-offs.
- Host: GitHub
- URL: https://github.com/fadouse/jvmbenchmark
- Owner: Fadouse
- License: mit
- Created: 2024-11-19T11:51:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-07T09:19:29.000Z (over 1 year ago)
- Last Synced: 2025-03-29T21:41:22.955Z (about 1 year ago)
- Topics: benchmark, java, jvm, performace-testing
- Language: Java
- Homepage:
- Size: 28.3 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# JVMBenchmark
## Table of Contents
- [Introduction](#introduction)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Test Categories](#test-categories)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Introduction
**JVMBenchmark** is a benchmarking tool developed to assess the performance implications of applying obfuscation techniques to Java applications. Built on JVM 17 and JDK 17, this project provides a suite of tests that measure various aspects of JVM performance before and after code obfuscation. Whether you're a developer aiming to secure your code or a performance engineer looking to understand the cost of obfuscation, JVMBenchmark offers valuable insights.
## Features
- **Comprehensive Test Suite:** Covers a wide range of JVM and Java language features.
- **Categorized Tests:** Organized into logical categories for easier analysis.
- **Easy Integration:** Simple setup process compatible with existing Java projects.
- **Detailed Reporting:** Generates detailed performance reports to highlight areas affected by obfuscation.
- **Extensible Framework:** Easily add new tests to accommodate specific benchmarking needs.
## Prerequisites
- **Java Development Kit (JDK) 17:** Ensure that JDK 17 is installed on your system.
- **Maven or Gradle:** For building and managing project dependencies.
- **Obfuscation Tool:** Any Java obfuscator compatible with your project (e.g., ProGuard, DexGuard).
## Installation
1. **Clone the Repository:**
```bash
git clone https://github.com/yourusername/JVMBenchmark.git
cd JVMBenchmark
```
2. **Build the Project:**
Using Maven:
```bash
mvn clean install
```
Using Gradle:
```bash
gradle build
```
3. **Configure Your Obfuscator:**
Set up your preferred obfuscation tool and configure it according to your project's requirements.
## Usage
1. **Run Baseline Tests:**
Execute the test suite without applying obfuscation to gather baseline performance metrics.
```bash
java -jar JVMBenchmark.jar
```
2. **Apply Obfuscation:**
Obfuscate your Java application using your chosen obfuscation tool.
3. **Run Obfuscated Tests:**
Execute the test suite on the obfuscated code to measure performance changes.
```bash
java -jar JVMBenchmark.jar
```
4. **Compare Results:**
Analyze the generated reports to identify performance impacts caused by obfuscation.
## Test Categories
JVMBenchmark includes a variety of tests categorized as follows:
- **Data Structure Tests**
- `HashTableTest`
- **Sorting Tests**
- `SortTest`
- **Garbage Collection Tests**
- `GCTest`
- `RealTimeGarbageCollectionTest`
- `GarbageCollectorComparisonTest`
- **Class Loading & Unloading Tests**
- `ClassLoadingTest`
- `ClassUnloadingTest`
- **JIT Compilation Tests**
- `JITCompilationTest`
- `JITCompilerOptimizationTest`
- `StartupAndJITWarmupTest`
- **Language Feature Tests**
- `PatternMatchingTest`
- `RecordsTest`
- `SealedClassesTest`
- `LambdaTest`
- `IndyTest`
- **Reflection & Dynamic Proxy Tests**
- `ReflectionTest`
- `DynamicProxyTest`
- `ReflectionAndDynamicProxyTest`
- **Thread & Concurrency Tests**
- `ThreadCreationTest`
- `SynchronizationTest`
- `ThreadPoolTest`
- `ThreadLocalTest`
- **Object & Memory Management Tests**
- `ObjectCreationTest`
- `EscapeAnalysisTest`
- `MemoryUsageTest`
- **String & Text Operations Tests**
- `StringOperationsTest`
- `TextParsingTest`
- `StringInterningTest`
- **Stream Operations Tests**
- `SequentialStreamTest`
- `ParallelStreamTest`
- `StreamOperationsChainTest`
- **Serialization Tests**
- `JavaSerializationTest`
- **Exception Handling Tests**
- `ExceptionHandlingTest`
- **Cache Efficiency Tests**
- `CacheEfficiencyTest`
- **Code Analysis & Instrumentation Overhead Tests**
- `CodeAnalysisInstrumentationOverheadTest`
## Contributing
We welcome contributions from the community! Whether it's adding new tests, improving documentation, or reporting issues, your input is valuable.
1. **Fork the Repository**
2. **Create a Feature Branch**
```bash
git checkout -b feature/YourFeature
```
3. **Commit Your Changes**
4. **Push to the Branch**
```bash
git push origin feature/YourFeature
```
5. **Open a Pull Request**
Please ensure your code adheres to the project's coding standards and includes relevant tests.
## License
This project is licensed under the [MIT License](LICENSE).
## Contact
For any questions or suggestions, feel free to open an issue or contact [fadouse@turings.org](mailto:fadouse@turings.org).
---
*Happy Benchmarking! 🚀*