New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rocket v5 (async) bencmark #2
Comments
At this point I think we are testing different things. So I change warp codebase to match Rocket. modified warp/src/main.rs
@@ -2,8 +2,8 @@ use warp::Filter;
#[tokio::main]
async fn main() {
- // GET /hello/warp => 200 OK with body "Hello, warp!"
- let hello = warp::path!("hello" / String).map(|name| format!("Hello, {}!", name));
+ // GET / => 200 OK with body "Hello, wolrd!"
+ let hello = warp::any().map(|| "Hello, world!");
- warp::serve(hello).run(([127, 0, 0, 1], 3030)).await;
+ warp::serve(hello).run(([127, 0, 0, 1], 8000)).await;
} The result is:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I try to run the benchmark against the master branch of https://github.com/SergioBenitez/Rocket (v5).
To see if there is any speed improvement. Because it's already async.
I run the benchmark to
warp
, to see my machine capability.warp
❯ cd warp ❯ cargo build --release ❯ ./target/release/warp
Rocket v4
❯ cd rocket ❯ cargo +nightly build --release ❯ ./target/release/rocket
Rocket v5
Rocket v5 (ROCKET_ENV=prod)
Rocket v5 (witch
async
keyword)Summary
warp: 286_126.89, 259_381.43, 238_068.17
Rocket v4: 72_045.45, 67_683.32, 61_560.47
Rocket v5: 156_093.58, 144_278.36, 139_211.46
Rocket v5 (ROCKET_ENV=prod): 166_937.68, 151_402.49, 138_150.06
Rocket v5 (witch
async
keyword): 159_601.93, 141_319.52, 131_921.73Machine
I have made my machine quite before running the benchmark.
Notes
IMHO, to make the command
wrk --latency -t4 -c200 -d8s http://127.0.0.1:8080
consistent. We need to set each port of the web framework to8080
The text was updated successfully, but these errors were encountered: