Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Created April 8, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseluisq/4bb7c0c86086992bfb121b0845298d0e to your computer and use it in GitHub Desktop.
Save joseluisq/4bb7c0c86086992bfb121b0845298d0e to your computer and use it in GitHub Desktop.
Rust web frameworks benchmark focus on static-file serving.
This is an opinioned benchmark that I have made for testing some Rust web frameworks focus on static-file serving feature using the minimal code that every framework provides.
Yes! This can vary per use case and is just another "benchmark".
-------------------------------------
OS: Arch Linux
Kernel: Linux 5.6.2-arch1-2 x86_64
------
$ rustc -vV
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-unknown-linux-gnu
release: 1.42.0
LLVM version: 9.0
------
NOTE: Examples are using `cargo build --release --target x86_64-unknown-linux-musl` except the first one.
-------------------------------------
Load Testing used:
Date: 2020-04-08T21:04:07 UTC
echo "GET http://localhost:8787" |
vegeta -cpus=12 attack -workers=10 -duration=60s -connections=10000 -rate=200 -http2=false
-------------------------------------
1) gotham = "0.4.0" (cargo run)
-------------------------------------
Bucket # % Histogram
[0s, 2ms] 11219 93.49% ######################################################################
[2ms, 4ms] 635 5.29% ###
[4ms, 6ms] 90 0.75%
[6ms, +Inf] 56 0.47%
2) gotham = "0.4.0" (cargo build --release --target x86_64-unknown-linux-musl)
-------------------------------------
Bucket # % Histogram
[0s, 2ms] 11731 97.76% #########################################################################
[2ms, 4ms] 226 1.88% #
[4ms, 6ms] 33 0.27%
[6ms, +Inf] 10 0.08%
3) iron = "0.6.1" (cargo build --release --target x86_64-unknown-linux-musl)
-------------------------------------
Bucket # % Histogram
[0s, 2ms] 10004 83.37% ##############################################################
[2ms, 4ms] 1515 12.62% #########
[4ms, 6ms] 356 2.97% ##
[6ms, +Inf] 125 1.04%
4) warp = "0.2" (cargo build --release --target x86_64-unknown-linux-musl)
-------------------------------------
Bucket # % Histogram
[0s, 2ms] 11579 96.49% ########################################################################
[2ms, 4ms] 313 2.61% #
[4ms, 6ms] 73 0.61%
[6ms, +Inf] 35 0.29%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment