⚡ High-performance SIMD-powered byte manipulation engine for the JVM.
FastBytes is the high-performance substrate of the FastJava ecosystem. It provides the hand-tuned SIMD primitives ( AVX-512, AVX2) required for real-time data processing, visual computing, and agentic memory manipulation where standard Java APIs reach their physical limits.
import fastbytes.FastBytes;
public class Demo {
public static void main(String[] args) {
// 1. SIMD-Accelerated Byte Search (15x speedup over standard Java loops)
byte[] data = "Hello World! FastBytes SIMD Engine Active.".getBytes();
int index = FastBytes.indexOf(data, (byte) 'V');
System.out.println("Found target byte at index: " + index);
// 2. High-Speed SIMD Buffer Fill
byte[] buffer = new byte[1024];
FastBytes.fill(buffer, (byte) 0xFF);
// 3. Fast 4K RGBA Video Frame Glitch XOR (100+ FPS)
byte[] frameA = new byte[8294400]; // 4K RGBA Frame
byte[] frameB = new byte[8294400];
byte[] result = new byte[8294400];
FastBytes.xor(frameA, frameB, result);
System.out.println("4K Glitch XOR completed at 100+ FPS.");
}
}- Quick Start — Example
- Key Features
- Performance
- API Quick Reference
- Installation
- Documentation
- Platform Support
- Related Projects
- License
- ⏱️ SIMD Copy: Up to 10x faster than
System.arraycopyfor large blocks. - 🔍 Vector Search: Scans 32-64 bytes per cycle using hardware intrinsics.
- ⚙️ Native XOR: Optimized for cryptographic and visual processing.
- 📦 Zero Dependencies: Purely native acceleration via JNI.
Measured on Modern x64 Hardware (AVX-512BW enabled).
| Operation | Buffer Size | Java (Standard) | FastBytes (0.1.1) | Speedup |
|---|---|---|---|---|
| XOR | 4K Frame | ~52 ms | ~2 ms | 26x |
| Search | 500 MB | ~215 ms | ~30 ms | 7.2x |
| Copy | 1 GB | ~170 ms | ~118 ms | 1.4x |
| Fill | 1 GB | ~110 ms | ~85 ms | 1.3x |
Read the full manifest in PHILOSOPHY.md.
| Method | Description | Path |
|---|---|---|
copy(...) |
High-speed memory migration (64-byte unrolled). | Reference đź“– |
indexOf(...) |
AVX-512 accelerated byte scanner. | Reference đź“– |
xor(...) |
128-byte vector XOR engine (Visual/Crypto). | Reference đź“– |
fill(...) |
Rapid buffer zeroing/initialization. | Reference đź“– |
hashXXH32(...) |
SIMD-ready xxHash implementation. | Reference đź“– |
Tip
See REFERENCE.md for full JNI contracts and fallback rules.
Add the JitPack repository and the dependencies to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastBytes Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastBytes</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastSIMD Hardware Vector Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastSIMD</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastMemory Aligned Allocator -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastMemory</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastPointer Primitive Address Wrapper -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastPointer</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastCore Native Loader -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.1</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastBytes:0.1.1'
implementation 'com.github.andrestubbe:FastSIMD:0.1.1'
implementation 'com.github.andrestubbe:FastMemory:0.1.1'
implementation 'com.github.andrestubbe:FastPointer:0.1.1'
implementation 'com.github.andrestubbe:FastCore:0.1.1'
}Download the latest JARs directly to add them to your classpath:
- 📦 FastBytes-0.1.1.jar (Core Library)
- ⚡ FastSIMD-0.1.1.jar (Hardware Vector Engine)
- đź’ľ FastMemory-0.1.1.jar (32-Byte Aligned Allocator)
- 📍 FastPointer-0.1.1.jar (Native Primitive Pointer)
- ⚙️ fastcore-0.1.0.jar (Required Native JNI Loader)
Important
All JARs must be in your classpath for the native JNI calls to function correctly.
See the examples/Benchmark directory for technical implementations and official JMH benchmarks:
| Benchmark Case | Description | Java Example | JMH Benchmark |
|---|---|---|---|
| SIMD Search | 3-Way Search (SIMD vs Prefetching vs Java) | SearchRace.java | JMH_Search.java |
| XOR Glitch | 4K RGBA Video Frame XOR | XorRace.java | JMH_Xor.java |
| Bulk Copy | Off-Heap Aligned Copy vs System.arraycopy | CopyRace.java | JMH_Copy.java |
run-benchmark.bat- COMPILE.md: Full compilation guide (MSVC C++17 build chain + JNI Setup).
- REFERENCE.md: Full API descriptions, border configurations, and codepoint index.
- PHILOSOPHY.md: The engineering rationale for zero-allocation performance.
- ROADMAP.md: Future milestones and planned features.
| Platform | Status |
|---|---|
| Windows 10/11 | âś… Fully Supported |
| Linux | đź”— Planned |
| macOS | đź”— Planned |
MIT License See LICENSE file for details.
- FastSIMD — Hardware vector acceleration engine (AVX2, AVX-512, NEON)
- FastMemory — SIMD 32-byte aligned off-heap memory allocation and page locking
- FastPointer — Zero-overhead native address arithmetic
- FastSharedMemory — Ultra-fast zero-copy IPC and shared memory mapped files
- FastCore — Native JNI loader for FastJava libraries
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋
