This folder contains performance tests for the RustAPI framework.
Tests the internal components of the framework:
- Routing: URL matching speed
- JSON Serialization: Serialize/deserialize performance
- Extractors: Path, Query, Json extractor speeds
End-to-end performance with real HTTP requests:
- Hello World: Simple text response
- JSON Response: JSON serialized response
- Path Parameters: Dynamic route parameters
- JSON Parsing: Request body parsing
cargo bench# Run the automated benchmark script
.\benches\run_benchmarks.ps1| Feature | RustAPI | Actix-web | Axum | FastAPI (Python) |
|---|---|---|---|---|
| Performance | ~92k req/s | ~105k | ~100k | ~12k |
| DX (Simplicity) | 🟢 High | 🔴 Low | 🟡 Medium | 🟢 High |
| Boilerplate | Zero | High | Medium | Zero |
| AI/LLM Native | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Stability Logic | 🛡️ Facade | ✅ Stable |
Note: Benchmarks depend on system environment. These results were taken on a developer machine with 1000 requests and 5 concurrency.
When compared to Actix-web, RustAPI offers:
- Developer Experience (DX): FastAPI-like ergonomics
- Automatic OpenAPI: Documentation is automatically generated as you write code
- Built-in Validation: Automatic 422 errors with
#[validate]macros - Simpler API: Less boilerplate, more readable code
- Hyper 1.0: Modern and stable HTTP stack
- RustAPI delivers near Actix-web performance in raw speed (90-95%)
- This difference is negligible in real-world applications
- DX gains are more valuable than the small performance difference
- API-first projects
- Projects requiring OpenAPI/Swagger documentation
- Rapid prototyping
- JSON-heavy REST APIs
- Maximum raw performance is critical
- WebSocket-heavy applications
- Large projects requiring a mature ecosystem