⚡ 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);
}
}
}- 🔍 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.
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 dependencies to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastSIMD Library -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastSIMD</artifactId>
<version>0.1.0</version>
</dependency>
<!-- FastCore (Mandatory Native Loader) -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>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- Description.md: Architectural overview and core module capabilities.
- COMPILE.md: Full compilation guide (MSVC C++17 build chain + JNI Setup).
- REFERENCE.md: Full API descriptions and technical method specifications.
- PHILOSOPHY.md: Engineering rationale for zero-allocation performance.
- ROADMAP.md: Future milestones and planned features.
- CHANGELOG.md: Version history and release notes.
| 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. 🚀📋