Skip to content

Commit eeda59f

Browse files
Add water-http framework (#10255)
* Add water-http framework * benchmark_config.json update
1 parent 65fc874 commit eeda59f

18 files changed

+1315
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target
2+
Cargo.lock
3+
.idea
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[package]
2+
name = "water-http"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
[dependencies]
7+
askama = "0.14.0"
8+
tokio = { version = "1.47.1", features = ["full"] }
9+
water_http = {git = "https://github.com/HassanSharara/water_http.git", branch = "beta", features = ["use_only_http1"],optional = true , version = "3.0.8-beta.5" }
10+
smallvec = "1.15.1"
11+
nanorand = "0.8.0"
12+
tokio-postgres = "0.7.15"
13+
sonic-rs = "0.5.5"
14+
bytes = "1.10.1"
15+
serde = { version = "1.0.228", features = ["derive","rc"] }
16+
futures-util = "0.3.31"
17+
num_cpus = "1.17.0"
18+
httpdate = "1.0.3"
19+
parking_lot = "0.12.5"
20+
yarte = { version = "0.15.7" ,features = ["bytes-buf", "json"] }
21+
itoa = {version = "1.0.15" ,optional = true}
22+
23+
24+
[[bin]]
25+
name = "plaintext"
26+
path = "src/plaintext.rs"
27+
required-features = ["json_plaintext"]
28+
29+
[[bin]]
30+
name = "json"
31+
path = "src/json.rs"
32+
required-features = ["json_plaintext"]
33+
34+
35+
[[bin]]
36+
name = "cache"
37+
path = "src/cached.rs"
38+
required-features = ["cache"]
39+
40+
41+
[features]
42+
json_plaintext = ["water_http"]
43+
db = ["water_http/thread_shared_struct"]
44+
cache = ["water_http/thread_shared_struct","itoa"]
45+
all = ["water_http/thread_shared_struct"]

frameworks/Rust/water-http/README

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
🌊 Water HTTP — TechEmpower Benchmarks
2+
3+
Water HTTP is a high-performance Rust web framework built and optimized for the TechEmpower Framework Benchmarks (TFB)
4+
. 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.
5+
6+
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.
7+
8+
⚡ Highlights
9+
10+
🚀 One of the fastest and most stable frameworks in the TechEmpower Benchmarks
11+
12+
🧵 Built entirely on Tokio’s asynchronous runtime — no io_uring or unsafe code
13+
14+
💾 Zero-copy I/O, preallocated buffers, and predictable memory layout
15+
16+
🔒 100% safe Rust with no hidden synchronization overhead
17+
18+
🧱 Designed for consistent high performance at scale
19+
20+
21+
🧠 Architecture
22+
23+
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.
24+
25+
[ tokio::net::TcpListener ]
26+
27+
[ connection handler ]
28+
29+
[ water::http::parser ]
30+
31+
[ application logic ]
32+
33+
[ response encoder ]
34+
This approach ensures optimal throughput and minimal per-request overhead while keeping code simple and safe.
35+
36+
37+
🧭 Mission
38+
39+
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.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"framework": "water-http",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"fortune_url": "/fortunes",
9+
"db_url": "/db",
10+
"query_url": "/queries?q=",
11+
"update_url": "/updates?q=",
12+
"port": 8080,
13+
"approach": "Realistic",
14+
"classification": "Micro",
15+
"database": "Postgres",
16+
"framework": "water_http",
17+
"language": "Rust",
18+
"orm": "raw",
19+
"platform": "Rust",
20+
"webserver": "water_http",
21+
"os": "Linux",
22+
"database_os": "Linux",
23+
"display_name": "water_http"
24+
},
25+
26+
"db": {
27+
"fortune_url": "/fortunes",
28+
"db_url": "/db",
29+
"query_url": "/queries?q=",
30+
"update_url": "/updates?q=",
31+
"port": 8080,
32+
"approach": "Realistic",
33+
"classification": "Micro",
34+
"database": "Postgres",
35+
"framework": "water_http",
36+
"language": "Rust",
37+
"orm": "raw",
38+
"platform": "Rust",
39+
"webserver": "water_http",
40+
"os": "Linux",
41+
"database_os": "Linux",
42+
"display_name": "water_http"
43+
},
44+
45+
"cached": {
46+
"cached_query_url": "/cached-queries?q=",
47+
"port": 8080,
48+
"approach": "Realistic",
49+
"classification": "Micro",
50+
"database": "Postgres",
51+
"framework": "water_http",
52+
"language": "Rust",
53+
"orm": "raw",
54+
"platform": "Rust",
55+
"webserver": "water_http",
56+
"os": "Linux",
57+
"database_os": "Linux",
58+
"display_name": "water_http"
59+
},
60+
"json": {
61+
"json_url": "/json",
62+
"port": 8080,
63+
"approach": "Realistic",
64+
"classification": "Micro",
65+
"framework": "water_http",
66+
"language": "Rust",
67+
"orm": "raw",
68+
"platform": "Rust",
69+
"webserver": "water_http",
70+
"os": "Linux",
71+
"database_os": "Linux",
72+
"display_name": "water_http"
73+
},
74+
"plaintext": {
75+
"plaintext_url": "/plaintext",
76+
"port": 8080,
77+
"approach": "Realistic",
78+
"classification": "Micro",
79+
"framework": "water_http",
80+
"language": "Rust",
81+
"orm": "raw",
82+
"platform": "Rust",
83+
"webserver": "water_http",
84+
"os": "Linux",
85+
"database_os": "Linux",
86+
"display_name": "water_http"
87+
}
88+
}
89+
]
90+
}

0 commit comments

Comments
 (0)