Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frameworks/Rust/water-http/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
Cargo.lock
.idea
45 changes: 45 additions & 0 deletions frameworks/Rust/water-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[package]
name = "water-http"
version = "0.1.0"
edition = "2018"

[dependencies]
askama = "0.14.0"
tokio = { version = "1.47.1", features = ["full"] }
water_http = {git = "https://github.com/HassanSharara/water_http.git", branch = "beta", features = ["use_only_http1"],optional = true , version = "3.0.8-beta.5" }
smallvec = "1.15.1"
nanorand = "0.8.0"
tokio-postgres = "0.7.15"
sonic-rs = "0.5.5"
bytes = "1.10.1"
serde = { version = "1.0.228", features = ["derive","rc"] }
futures-util = "0.3.31"
num_cpus = "1.17.0"
httpdate = "1.0.3"
parking_lot = "0.12.5"
yarte = { version = "0.15.7" ,features = ["bytes-buf", "json"] }
itoa = {version = "1.0.15" ,optional = true}


[[bin]]
name = "plaintext"
path = "src/plaintext.rs"
required-features = ["json_plaintext"]

[[bin]]
name = "json"
path = "src/json.rs"
required-features = ["json_plaintext"]


[[bin]]
name = "cache"
path = "src/cached.rs"
required-features = ["cache"]


[features]
json_plaintext = ["water_http"]
db = ["water_http/thread_shared_struct"]
cache = ["water_http/thread_shared_struct","itoa"]
all = ["water_http/thread_shared_struct"]
39 changes: 39 additions & 0 deletions frameworks/Rust/water-http/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
🌊 Water HTTP — TechEmpower Benchmarks

Water HTTP is a high-performance Rust web framework built and optimized for the TechEmpower Framework Benchmarks (TFB)
. It is designed to push the limits of speed, stability, and scalability using pure asynchronous Rust and Tokio’s runtime. Every part of the framework is hand-tuned to achieve predictable latency, minimal allocations, and efficient CPU utilization under extreme concurrency.

This repository contains the official benchmark implementations for all test types, including Plaintext, JSON serialization, Single query, Multiple queries, Fortunes, Database updates, and Cached queries.

⚡ Highlights

🚀 One of the fastest and most stable frameworks in the TechEmpower Benchmarks

🧵 Built entirely on Tokio’s asynchronous runtime — no io_uring or unsafe code

💾 Zero-copy I/O, preallocated buffers, and predictable memory layout

🔒 100% safe Rust with no hidden synchronization overhead

🧱 Designed for consistent high performance at scale


🧠 Architecture

Water HTTP is built around a fully asynchronous, event-driven architecture that leverages non-blocking I/O and efficient request processing. The system is designed to eliminate unnecessary locks and minimize latency even under heavy load.

[ tokio::net::TcpListener ]
[ connection handler ]
[ water::http::parser ]
[ application logic ]
[ response encoder ]
This approach ensures optimal throughput and minimal per-request overhead while keeping code simple and safe.


🧭 Mission

Water HTTP’s mission is to demonstrate how Rust’s async ecosystem can reach record-breaking performance without compromising simplicity, safety, or maintainability. It shows that carefully engineered async Rust can deliver unmatched speed and reliability in real-world workloads, setting a new standard for what modern web frameworks can achieve.
90 changes: 90 additions & 0 deletions frameworks/Rust/water-http/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"framework": "water-http",
"tests": [
{
"default": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"fortune_url": "/fortunes",
"db_url": "/db",
"query_url": "/queries?q=",
"update_url": "/updates?q=",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"database": "Postgres",
"framework": "water_http",
"language": "Rust",
"orm": "raw",
"platform": "Rust",
"webserver": "water_http",
"os": "Linux",
"database_os": "Linux",
"display_name": "water_http"
},

"db": {
"fortune_url": "/fortunes",
"db_url": "/db",
"query_url": "/queries?q=",
"update_url": "/updates?q=",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"database": "Postgres",
"framework": "water_http",
"language": "Rust",
"orm": "raw",
"platform": "Rust",
"webserver": "water_http",
"os": "Linux",
"database_os": "Linux",
"display_name": "water_http"
},

"cached": {
"cached_query_url": "/cached-queries?q=",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"database": "Postgres",
"framework": "water_http",
"language": "Rust",
"orm": "raw",
"platform": "Rust",
"webserver": "water_http",
"os": "Linux",
"database_os": "Linux",
"display_name": "water_http"
},
"json": {
"json_url": "/json",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"framework": "water_http",
"language": "Rust",
"orm": "raw",
"platform": "Rust",
"webserver": "water_http",
"os": "Linux",
"database_os": "Linux",
"display_name": "water_http"
},
"plaintext": {
"plaintext_url": "/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"framework": "water_http",
"language": "Rust",
"orm": "raw",
"platform": "Rust",
"webserver": "water_http",
"os": "Linux",
"database_os": "Linux",
"display_name": "water_http"
}
}
]
}
Loading