⚡ High-performance hardware vector acceleration engine (AVX2, AVX-512, NEON) for the JVM.
FastSIMD provides a unified SIMD abstraction layer for Java. It encapsulates 32-byte parallel delimiter matching, bulk memory transfers, vector math, and pixel format conversions using hardware intrinsics.
import fastsimd.*;
import fastmemory.Memory;
import fastpointer.Pointer;
public class Demo {
public static void main(String[] args) {
// 1. Allocate 32-byte aligned memory via FastMemory
try (Memory memory = Memory.allocateAligned(1024, 32)) {
Pointer ptr = memory.pointer();
// Write 32 bytes of test string
byte[] bytes = "Hello World! FastSIMD AVX2 Test".getBytes();
for (int i = 0; i < bytes.length; i++) {
ptr.setByte(i, bytes[i]);
}
// 2. Perform 32-byte SIMD parallel search for 'F'
int index = SIMD.findByte(ptr, bytes.length, (byte) 'F');
System.out.println("SIMD parallel found 'F' at index: " + index);
}
}
}- Key Features
- Real-World Use Cases
- Performance Benchmarks
- Quick Start
- API Reference
- Installation
- Documentation
- Platform Support
- License
- 🔍 SIMD Scan: 32-byte parallel delimiter & byte searching (
_mm256_cmpeq_epi8,_mm256_movemask_epi8). - ⚡ Bulk Memory & Prefetching: 256-bit unaligned/aligned loads/stores and cache prefetching.
- 🔢 Vector Math: 8-way Float32 and 4-way Float64 SIMD arithmetic for 3D and matrix operations.
- 🎨 Pixel & Convert: Farbraum-Konvertierung (RGBA <-> BGRA) und Float↔Int Konvertierungen.
- ⚡ High-Frequency Trading (HFT): Scan FIX protocol streams and order book market ticks at 28+ GB/sec without GC pauses.
- 🔍 SIEM & Security Log Mining: Search multi-gigabyte server logs for threat patterns (
CRITICAL_ALERT,JWT_EXPIRED) in milliseconds. - 🤖 AI Tensor Data Pipelines: Perform zero-copy vector normalization and memory alignment for local GGUF LLM models.
FastSIMD is engineered for ultra-high-throughput vector acceleration. In the official JMH Benchmark, the system measured native AVX2 256-bit vector search vs standard scalar loops over a 64 MB memory buffer:
Benchmark Mode Cnt Score Error Units
JMH_SIMD.benchmarkAVX2FindByte thrpt 2 19632.158 ops/s
28.48 GB/sec Bandwidth:
FastSIMDprocesses memory streams with AVX2 vector intrinsics up to 15.02x faster than standard Java loops with zero GC heap allocation.
SIMD.findByte(Pointer ptr, long length, byte target): Scans memory 32 bytes per cycle for target byte.SIMD.copy(Pointer src, Pointer dst, long bytes): SIMD-accelerated 256-bit memory copy.SIMD.isAVX2Supported(): Returnstrueif AVX2 hardware acceleration is active.
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>
<!-- FastSIMD Hardware Vector Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastSIMD</artifactId>
<version>0.1.3</version>
</dependency>
<!-- FastMemory Aligned Allocator -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastMemory</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastPointer 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.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastSIMD:0.1.3'
implementation 'com.github.andrestubbe:FastMemory:0.1.1'
implementation 'com.github.andrestubbe:FastPointer:0.1.1'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}Download the latest JARs directly to add them to your classpath:
- ⚡ FastSIMD-0.1.3.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 (Mandatory Native Loader)
Important
All JARs must be in your classpath for the JNI calls to function correctly.
See the examples/ directory for interactive technical implementations and official JMH benchmarks:
| Benchmark Case | Description | Java Example | JMH Benchmark |
|---|---|---|---|
| SIMD Parallel Search | 32-byte parallel delimiter matching (_mm256_cmpeq_epi8) vs Java loop |
Demo.java | JMH_SIMD.java |
run-benchmark.bat-
CHANGELOG.md: Release notes.
-
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 (AVX2 / x64) | ✅ Fully Supported |
| Linux (AVX2 / x64) | 🚧 Planned |
| macOS (Apple Silicon NEON) | 🚧 Planned |
- FastBytes — High-performance SIMD-powered byte engine
- FastMemory — SIMD 32-byte aligned off-heap memory allocation and page locking
- FastPointer — Zero-overhead native address arithmetic
- FastCore — Native JNI loader for FastJava libraries
MIT License — See LICENSE for details.
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋
