Skip to content

andrestubbe/FastBytes

Repository files navigation

FastBytes v0.1.0 [ALPHA] — High-performance SIMD-powered byte engine for Java

Status License: MIT Java Platform JitPack


⚡ 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.


FastFileIndex Showcase


Table of Contents


// Quick Start — SIMD Search
byte[] data = ...; // 500MB buffer
int index = FastBytes.indexOf(data, (byte) 0x42); 

Key Features

  • ⚡ SIMD Copy: Up to 10x faster than System.arraycopy for 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.

📊 Performance (v0.1.0)

Measured on Modern x64 Hardware (AVX-512BW enabled).

Operation Buffer Size Java (Standard) FastBytes (v0.1.0) 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 PHILOSOPHIE.md.

🗺️ Next Steps

  • Kernel Fastpaths: DMA-based bulk copying (CopyFile2).
  • 3-Way Fill: Hardware-optimized memory zeroing.
  • Apple Silicon: Native NEON port for ARM64.

See the full ROADMAP.md for details.


API Quick Reference

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.

Installation

Option 1: Maven (Recommended)

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 Library -->
<dependency>
    <groupId>com.github.andrestubbe</groupId>
    <artifactId>fastbytes</artifactId>
    <version>v0.1.0</version>
</dependency>

<!-- FastCore (Required Native Loader) -->
<dependency>
    <groupId>com.github.andrestubbe</groupId>
    <artifactId>fastcore</artifactId>
    <version>v0.1.0</version>
</dependency>
</dependencies>

Option 2: Gradle (via JitPack)

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.andrestubbe:fastbytes:v0.1.0'
    implementation 'com.github.andrestubbe:fastcore:v0.1.0'
}

Option 3: Direct Download (No Build Tool)

Download the latest JARs directly to add them to your classpath:

  1. 📦 **fastbytes-v0.1.0.jar ** (The Core Library)
  2. ⚙️ fastcore-v0.1.0.jar ( The Mandatory Native Loader)

Important

All JARs must be in your classpath for the native JNI calls to function correctly.

Technical Examples & Hero Demos

See the examples/ directory for technical implementations and high-speed races:

Case Java Example Performance Race / Demo JMH Benchmark
XOR XorRace.java “Real-Time XOR Visualizer” (4K @ 666 FPS) JMH_Xor.java
Search SearchRace.java “SIMD Search vs Java Loop” (7.2x speedup) JMH_Search.java
Copy CopyRace.java “1GB Copy Race” (1.4x speedup) JMH_Copy.java
Fill FillRace.java “1GB Zero-Fill Race” (1.3x speedup) JMH_Fill.java
Hash HashRace.java “100MB xxHash Battle” (xxHash32 Speed) JMH_Hash.java

Documentation

  • COMPILE.md: Full compilation guide (MSVC C++17 build chain + JNI Setup).
  • REFERENCE.md: Full API descriptions, border configurations, and codepoint index.
  • PHILOSOPHIE.md: The engineering rationale for zero-allocation performance.
  • ROADMAP.md: Future milestones and planned features.

Platform Support

Platform Status
Windows 10/11 ✅ Fully Supported
Linux 🚧 Planned
macOS 🚧 Planned

License

MIT License — See LICENSE file for details.


Related Projects


Part of the FastJava EcosystemMaking the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋

About

High-performance byte array operations with SIMD acceleration for the JVM. Part of the FastJava ecosystem.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors