FastSerial
fastserial is a high-performance, zero-copy serialization and deserialization framework for Rust. It is an ambitious project designed as an alternative for high-throughput use cases like REST APIs, game engines, and real-time data processing, focusing on minimizing overhead and maximizing efficiency.
🚀 Key Features
- Ambitious Performance: Designed for high throughput by using specialized code generation and SIMD-accelerated scanning.
- Zero-Copy Deserialization: Borrow directly from input buffers (e.g.,
&str,&[u8]) to avoid heap allocations. - SIMD-First Design: Native AVX2 and SSE4.2 support for parsing and escaping.
- Minimal Dependencies: Fast compilation and small binary footprint.
- No-Std Support: Optimized for embedded environments and WASM.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
🛠️ Usage
use ;
🛠️ Development
This project uses a Makefile to simplify common development tasks.
# Run all quality checks (fmt, lint, test, build)
# Run specific tasks
📊 Performance Goals
fastserial aims for high performance by focusing on specific optimizations like SIMD and zero-copy. For detailed performance aspirations and initial experimental numbers, see docs/BENCHMARKS.md.
| Scenarios | Design Choice | Target |
|---|---|---|
| JSON | SIMD + Zero-copy | High throughput |
| Binary | Direct Mapping | Ultra-low latency |
| Memory | Borrowing | Minimal allocations |
⚙️ Configuration
std(default): Enablesstdsupport.json(default): Enables JSON codec.binary(default): Enables the FastSerial binary format.msgpack: Enables MessagePack codec.chrono: Enables support forchronotypes.HashMap/BTreeMapserialization support.Tupleserialization support.json::Valuedynamic type for untyped JSON.json::encode_prettyfor human-readable output.
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for details on our development workflow and how to get started.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
📄 License
This project is licensed under the MIT License.