wrk is the binary used as injector, always used with these options:
./wrk -t12 -c1000 -d15s http://127.0.0.1:8080/
Processor : Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz
$ uname -a
Linux home 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
$ go version
go version go1.16.5 linux/amd64
$ rustc --version
rustc 1.54.0 (a178d0322 2021-07-26)
| Language | Framework | Requests/sec | Transfer/sec | Thread latency (avg) | Thread latency (max) | Compilation time | 
|---|---|---|---|---|---|---|
| Rust | Actix | 294315.51 | 34.80MB | 4.61ms | 56.76ms | 72.428s | 
| Rust | Hyper | 299736.48 | 38.02MB | 3.45ms | 206.41ms | 50.062s | 
| Go | httprouter | 187968.82 | 22.23MB | 7.08ms | 102.06ms | 0.214s | 
| Go | fasthttp | 334184.91 | 42.39MB | 4.20ms | 115.86ms | 0.491s | 
Running 15s test @ http://127.0.0.1:8080
  12 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.61ms    5.43ms  56.76ms   84.52%
    Req/Sec    24.77k     3.66k   58.62k    72.03%
  4442997 requests in 15.10s, 525.41MB read
Requests/sec: 294315.51
Transfer/sec:     34.80MB
Running 15s test @ http://127.0.0.1:8080
  12 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.45ms    3.11ms 206.41ms   84.82%
    Req/Sec    25.21k     3.33k   50.15k    75.17%
  4518451 requests in 15.07s, 573.11MB read
Requests/sec: 299736.48
Transfer/sec:     38.02MB
Running 15s test @ http://127.0.0.1:8080
  12 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.08ms    8.33ms 102.06ms   87.05%
    Req/Sec    15.83k     3.07k   36.62k    71.27%
  2836680 requests in 15.09s, 335.45MB read
Requests/sec: 187968.82
Transfer/sec:     22.23MB
Running 15s test @ http://127.0.0.1:8080
  12 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.20ms    6.00ms 115.86ms   88.23%
    Req/Sec    28.18k     5.64k   63.95k    70.16%
  5041567 requests in 15.09s, 639.47MB read
Requests/sec: 334184.91
Transfer/sec:     42.39MB
You will find source code as separate files in this gist.
cargo build --release
Cargo.toml
[package]
name = "actix"
version = "0.1.0"
edition = "2018"
[dependencies]
actix-web = "3.3.2"
./target/release/actix
cargo build --release
Cargo.toml
[package]
name = "hyper"
version = "0.1.0"
edition = "2018"
[profile.release]
lto = true
[dependencies]
hyper = { version = "0.14.11", features = ["full"] }
tokio = { version = "1.10.0", features = ["full"] }
./target/release/hyper
go mod init example.com/httprouter
go get github.com/julienschmidt/[email protected]
go build -ldflags "-s -w" httprouter.go
./httprouter
go mod init example.com/fashttp
go get github.com/valyala/[email protected]
go build -ldflags "-s -w" fasthttp.go
./fasthttp
For reference, this benchmark is dated in 2021 and is the result of this conversation: https://dev.to/r0mdau/comment/1h6kb
And few days after this git, Gleb continued to optimize Rust/warp to be faster than Go/fasthttp: https://medium.com/@glebpomykalov/lets-overtake-go-fasthttp-with-rust-hyper-b2d1004914f
Remember: The good tool for the good use ;)