🚧 Prototype Notice

This project (sufast) is currently a dummy prototype.
Only static routes are working at the moment.
Dynamic routing and full features are under development.
Thank you for understanding! πŸ™

Sufast/Documentation
Performance Benchmarks

Performance Analysis

Comprehensive performance benchmarks and analysis of Sufast compared to other popular web frameworks.

52,000+
Requests per second

Near-native Rust performance

2.1ms
Average latency

Lightning-fast response times

25MB
Memory usage

Efficient memory footprint

35ms
Startup time

Fast application startup

Framework Comparison
Comprehensive benchmark results across key performance metrics
FrameworkLanguage
RPS
Latency (ms)
Memory (MB)
Startup (ms)Developer UX
πŸ¦€ Native Rust (Actix-Web)πŸ¦€ Rust
56,000+πŸ”₯
~1.7~20~25⚠️ Manual, low-level routing
πŸš€ Sufast (Rust + Python)
Sufast
πŸ¦€ Rust + 🐍 Python
52,000+πŸ”₯
~2.1~25~35βœ… FastAPI-style, intuitive
🐍 FastAPI (Uvicorn)🐍 Python
25,000+
~5.6~60~90βœ… Very Dev-Friendly
🌐 Node.js (Express)JavaScript
35,000+
~4.2~50~40βœ… Dev-Friendly
Load Testing Setup
How we conducted the performance tests

Test Environment

  • β€’ AWS EC2 c5.xlarge instance (4 vCPUs, 8GB RAM)
  • β€’ Ubuntu 22.04 LTS
  • β€’ Python 3.11, Node.js 18, Rust 1.70
  • β€’ Load testing with k6

Test Scenario

  • β€’ Simple JSON API endpoint
  • β€’ 100 concurrent users
  • β€’ 30-second duration
  • β€’ Keep-alive connections
Test Code Example
k6 load testing script used for benchmarks
// k6 load test script
import http from 'k6/http';
import { check, sleep } from 'k6';

export let options = {
  vus: 100,        // 100 virtual users
  duration: '30s', // 30 seconds
};

export default function () {
  let res = http.get('http://localhost:8080/api/test');
  
  check(res, {
    'status is 200': (r) => r.status === 200,
    'response time < 10ms': (r) => r.timings.duration < 10,
  });
  
  sleep(0.001); // 1ms sleep between requests
}
Performance Analysis
Why Sufast achieves exceptional performance

πŸ¦€ Rust Core Advantages

  • β€’ Zero-cost abstractions
  • β€’ Memory safety without garbage collection
  • β€’ Efficient async I/O with Tokio
  • β€’ Optimized HTTP parsing and routing
  • β€’ SIMD optimizations for JSON processing

🐍 Python Integration

  • β€’ Minimal Python/Rust boundary crossings
  • β€’ Efficient data serialization
  • β€’ Async/await support
  • β€’ Familiar FastAPI-style API
  • β€’ Access to Python ecosystem

Architecture Overview

Sufast Architecturetext
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   HTTP Client   │───▢│   Rust Core     │───▢│  Python Handler β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ Browser       β”‚    β”‚ β€’ HTTP Server   β”‚    β”‚ β€’ Route Logic   β”‚
β”‚ β€’ API Client    β”‚    β”‚ β€’ Routing       β”‚    β”‚ β€’ Business Code β”‚
β”‚ β€’ Mobile App    β”‚    β”‚ β€’ Middleware    β”‚    β”‚ β€’ Database      β”‚
β”‚                 β”‚    β”‚ β€’ Serialization β”‚    β”‚ β€’ External APIs β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚                        β”‚
                              β–Ό                        β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚ Tokio Runtime   β”‚    β”‚ Python Runtime  β”‚
                       β”‚ β€’ Async I/O     β”‚    β”‚ β€’ asyncio       β”‚
                       β”‚ β€’ Thread Pool   β”‚    β”‚ β€’ Event Loop    β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜