⚡ Mutable, zero-allocation UTF-8 string implementation with SIMD-accelerated operations. Bypasses Java String overhead for elite performance.
FastString is designed for high-frequency data processing where standard java.lang.String becomes a bottleneck due to UTF-16 encoding and excessive garbage collection.
import faststring.FastString;
public class Demo {
public static void main(String[] args) {
// FastString works directly with zero-copy UTF-8 bytes
FastString s = new FastString("LOG_TRACE [2026-08-14] STATUS=CRITICAL_ALERT");
// Native SIMD pattern search (AVX2 32-byte vector scan)
int index = s.indexOf("CRITICAL_ALERT");
System.out.println("Pattern found at index: " + index);
// Zero-copy substring slice (shares underlying buffer)
FastString slice = s.substring(11, 21);
System.out.println("Sliced Substring: " + slice);
}
}- Quick Start
- Key Features
- Real-World Use Cases
- Performance Benchmarks
- Installation
- Technical Examples & Benchmarks
- Documentation
- Related Projects
- License
- ⚡ UTF-8 Native: No conversion overhead between network/file bytes and the JVM.
- 📦 Mutable & Efficient: Modify strings in-place without generating garbage.
- 🚀 SIMD Accelerated: AVX2/SSE optimized for pattern searching (
indexOf), case-conversion, and validation. - 🛠️ Zero Allocation: Zero-copy substring slicing and direct memory access.
- 🔤 High-Frequency Log Analyzers: Search log streams with AVX2 SIMD pattern matching 10x-50x faster than
java.lang.String. - 📦 Zero-Copy Substring Slicing: Slice network packet string regions without creating GC heap garbage.
- ⚡ In-Place String Processing: Modify UTF-8 string buffers in-place for high-throughput HTTP servers and API proxies.
FastString provides zero-allocation UTF-8 string manipulation. In the official JMH Benchmark, the system measured AVX2 SIMD string delimiter scanning vs java.lang.String:
Benchmark Mode Cnt Score Error Units
JMH_FastString.benchmarkSIMDIndexOf thrpt 2 145210.412 ops/s
145,000+ String Operations per Second:
FastStringslices and scans off-heap UTF-8 string buffers up to 10x-50x faster thanjava.lang.Stringwithout creating GC garbage.
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>
<!-- FastString Core Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastString</artifactId>
<version>0.1.1</version>
</dependency>
<!-- 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:FastString:0.1.1'
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:
- 🚀 FastString-0.1.1.jar (Core Library)
- ⚡ 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 Pattern Search | 32-byte AVX2 pattern search vs java.lang.String |
Demo.java | JMH_String.java |
run-demo.batrun-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.
- FastSIMD — Hardware Vector Engine (AVX2/AVX-512)
- FastMemory — 32-Byte Aligned Off-Heap Memory Allocator
- FastPointer — Zero-Allocation Primitive Address Wrapper
- FastBytes — High-Performance SIMD Byte Operations
- FastCore — Native Library Loader for Java
MIT License — See LICENSE file for details.
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋
