- Why?
- I’m mainly concerned with what I have in my development toolbelt - that means Python, JS, Clojure & Rust.
- It is widely known that Rust is the most performant language, but still I want to see how fast it is compared to other frameworks/libraries I’ve been using daily for enterprise-grade application development.
- Learning fun - Thats why!
NOTE
- source code for HTTPKit app is here
- no source code available for Light4j
- Tool: bombardier
- Concurrent connection: 100
- Duration: 30s
- Env: production for all test app
- Testing on a simple API that return sum of 2 numbers, in the following format
GET <host:port>/<lang>/plus?x=1&y=3
# response
{
"total": 4
}
- HTTPKit
$ bombardier -c 100 -d 30s "http://localhost:8080/clojure/plus?x=1&y=3"
Bombarding http://localhost:8080/clojure/plus?x=1&y=3 for 30s using 100 connection(s)
[====================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 30265.79 11146.13 48148.98
Latency 3.32ms 3.46ms 319.56ms
Throughput: 6.72MB/s
- FastAPI
$ bombardier -c 100 -d 30s "http://localhost:5000/python/plus?x=3&y=1"
Bombarding http://localhost:5000/python/plus?x=3&y=1 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 10740.29 1730.15 13932.79
Latency 9.32ms 8.50ms 379.46ms
Throughput: 2.22MB/s
NOTE: to be frank, I expected more from FastAPI :(
- Actix-Web
$ bombardier -c 100 -d 30s "http://localhost:8080/rust/plus?x=1&y=3"
Bombarding http://localhost:8080/rust/plus?x=1&y=3 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 81700.23 13506.45 93240.30
Latency 1.22ms 3.18ms 293.96ms
Throughput: 15.40MB/s
- Light-4J
$ bombardier -c 100 -d 30s "http://localhost:8080/light4j/plus?x=3&y=2"
Bombarding http://localhost:8080/light4j/plus?x=3&y=2 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 83641.34 11065.35 101699.66
Latency 1.21ms 5.73ms 308.53ms
Throughput: 16.11MB/s
- ActixWeb ~ Light-4J
- ActixWeb ~ 2.5x faster than HTTPKit
- HTTPKit ~ 3x faster than FastAPI
May add some more server-app later…