Measuring response times for each framework (middleware). Each framework has to have two features; routing and parsing path parameters.
Last update: 2017-10-04
OS: Darwin (version: 17.0.0, arch: x86_64)
CPU Cores: 8
- router_cr (crystal)
- raze (crystal)
- japronto (python)
- fasthttprouter (go)
- iron (rust)
- nickel (rust)
- rocket (rust)
- kemal (crystal)
- echo (go)
- gorilla_mux (go)
- iris (go)
- aspnetcore (csharp)
- plug (elixir)
- phoenix (elixir)
- vapor (swift)
- perfect (swift)
- kitura (swift)
- sanic (python)
- akkahttp (scala)
- clusterexpress (node)
- express (node)
- roda (ruby)
- sinatra (ruby)
- rails (ruby)
- crystal (router_cr)
- python (japronto)
- go (fasthttprouter)
- rust (iron)
- csharp (aspnetcore)
- elixir (plug)
- swift (vapor)
- scala (akkahttp)
- node (clusterexpress)
- ruby (roda)
| Language (Runtime) | Framework (Middleware) | Max [sec] | Min [sec] | Ave [sec] |
|---|---|---|---|---|
| ruby | rails | 151.196547 | 150.960227 | 151.073975 |
| ruby | sinatra | 43.854565 | 43.581662 | 43.664177 |
| ruby | roda | 15.892388 | 15.811082 | 15.844165 |
| crystal | kemal | 3.547369 | 3.075486 | 3.444593 |
| crystal | router_cr | 2.486733 | 2.284032 | 2.344394 |
| crystal | raze | 2.490715 | 2.399881 | 2.456708 |
| go | echo | 3.785530 | 3.511024 | 3.647536 |
| go | gorilla_mux | 3.970627 | 3.522344 | 3.686079 |
| go | iris | 3.938069 | 3.583784 | 3.776195 |
| go | fasthttprouter | 2.824961 | 2.686712 | 2.731345 |
| rust | iron | 2.865915 | 2.743227 | 2.812815 |
| rust | nickel | 2.877018 | 2.823066 | 2.858988 |
| rust | rocket | 3.276701 | 3.145324 | 3.204920 |
| node | express | 13.961471 | 13.668522 | 13.791606 |
| node | clusterexpress | 8.187491 | 7.431857 | 7.656550 |
| elixir | plug | 4.895296 | 4.368241 | 4.727784 |
| elixir | phoenix | 5.307217 | 4.877070 | 5.116376 |
| swift | vapor | 5.613291 | 5.250472 | 5.479300 |
| swift | perfect | 5.703425 | 5.575321 | 5.648020 |
| swift | kitura | 6.678699 | 6.379810 | 6.503248 |
| scala | akkahttp | 8.330310 | 7.047381 | 7.584030 |
| csharp | aspnetcore | 3.959679 | 3.799744 | 3.860993 |
| python | sanic | 7.359875 | 6.208559 | 6.735841 |
| python | japronto | 2.639756 | 2.590362 | 2.610999 |
- Ruby
- Crystal
- Go
- Rust
- node
- Elixir
- Swift
- Scala
- C#
- Python
See Development section when you want to add new languages or frameworks.
We want to know the response time, not a usability. So full-stack framework is at a disadvantage.
- Each server has no special logics.
- Each server's executable is named as
server_[Lauguage]_[Framework]. (For example,server_ruby_sinatra) - There are only 3 routes
- GET '/' return status code 200 with empty body
- GET '/user/:id' return status code 200 with the id
- POST '/user' return status code 200 with empty body
Required environment -> See Current target frameworks(middlewares)
Neph is a modern command line job processor that can be substitute for make command.
To compile servers and benchmarker,
> neph
For each language,
> neph -j ruby
For each framework,
> neph -j rails
See neph.yml
To compile servers and benchmarker,
> make
For each language,
> make ruby
For each framework,
> make rails
You can take a benchmark by
> bin/benchmarkerFor each language
> bin/benchmarker rubyFor each framework
> bin/benchmarker railsFor comparison (Comparing rails, kemal and router.cr in this example)
> bin/benchmarker rails crystalIf you take it manually, you can run each server by
> bin/server_[Language]_[Framework]and run client by
> time bin/clientYou can set # of threads and # of the loops of the request(there are 3 requests in a loop) by
> time bin/client -t 16 -r 1000In the above example, 16 threads requests 1000 * 3 times. So 48000 requests are sent in total.
Setup servers by using docker is under WIP. Currently, crystal and ruby servers are supported. For example
docker-compose up railsThen you can run your client by
time ./bin/client- Give me PR when you want to add other web frameworks
- Give me PR when you can tuning each framework (under the rule)
/[language]/[framework]/[codes]<- Project iteselfbenchmarker/benchmarker.cr<- Adding it as a target toREADME.md<- Adding it as a target framework of the listMakefileneph.yml(optional)
Anyway, you don't have to care about details since maintainer can fix them after merging it. The result will be updated by maintainer.
- Fork it (https://github.com/tbrand/which_is_the_fastest/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- tbrand Taichiro Suzuki - creator, maintainer
- OvermindDL1 OvermindDL1 - maintainer
1AE9P6TUVik1rJGQhaSqGWRk1oAQ3DJnmo
