💡 A high-performance native JSON module for the FastJava ecosystem. Optimized for raw throughput and zero-copy parsing via SIMD.
FastJSON delivers elite parsing performance by leveraging native SIMD instructions and optimized memory handling. Built for high-frequency API requests and massive data processing pipelines.
import fastjson.FastJSON;
import fastjson.FastJsonValue;
import java.nio.charset.StandardCharsets;
public class Demo {
public static void main(String[] args) {
// 1. Raw UTF-8 Bytes (Zero-Copy Parsing)
byte[] rawJson = ("{"
+ "\"status\":\"success\","
+ "\"model\":\"FastAI-v2\","
+ "\"tokens\":128,"
+ "\"payload\":{\"confidence\":0.994,\"tags\":[\"simd\",\"native\",\"fast\"]}"
+ "}").getBytes(StandardCharsets.UTF_8);
// 2. High-Speed SIMD Parse Root Node
FastJsonValue json = FastJSON.parse(rawJson);
// 3. Direct Field Extraction & Nested Objects
String status = json.getString("status");
int tokens = json.getInt("tokens");
double confidence = json.getObject("payload").getDouble("confidence");
System.out.println("Status: " + status);
System.out.println("Tokens: " + tokens);
System.out.println("Confidence: " + confidence);
// 4. Clean Memory Release
json.free();
}
}- Quick Start — Example
- Features
- Performance
- API Quick Reference
- Installation
- Technical Examples & Benchmarks
- Documentation
- Platform Support
- Related Projects
- License
- ⚡ SIMD Accelerated: Native JSON parsing via AVX2/SSE — no JVM overhead.
- 🚀 Zero-Copy: Direct access to native byte buffers, bypassing String allocation.
- 📈 Raw Performance: Optimized for massive data throughput (up to 50× faster than Jackson).
- 🔗 Ecosystem Ready: Seamless integration with FastIO, FastBytes, FastString and FastCore.
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>
<!-- FastJSON Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastJSON</artifactId>
<version>0.1.3</version>
</dependency>
<!-- FastSIMD Hardware Vector Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastSIMD</artifactId>
<version>0.1.3</version>
</dependency>
<!-- FastString String Foundation -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastString</artifactId>
<version>0.1.0</version>
</dependency>
<!-- FastBytes Byte Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastBytes</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.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastJSON:0.1.3'
implementation 'com.github.andrestubbe:FastSIMD:0.1.3'
implementation 'com.github.andrestubbe:FastString:0.1.0'
implementation 'com.github.andrestubbe:FastBytes: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.0'
}Download the latest JARs directly to add them to your classpath:
- 🚀 FastJSON-0.1.3.jar (Core Library)
- ⚡ FastSIMD-0.1.3.jar (Hardware Vector Engine)
- 📦 FastString-0.1.0.jar (String Foundation)
- 📦 FastBytes-0.1.1.jar (Byte 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 |
|---|---|---|---|
| JSON Parse Throughput | SIMD token scanning vs Java JSON parsers | Demo.java | JMH_JsonParse.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.
- FastCore — Native Library Loader for Java
- FastIO — Ultra-fast native file I/O for Java
- FastBytes — High-performance byte buffer engine
- FastString — Zero-allocation String processing
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. ⚡
