Measuring response times (routing times) for each framework (middleware). Each framework has to have two features; routing and parsing path parameters.
Last update: 2017-11-03
OS: Darwin (version: 17.2.0, arch: x86_64)
CPU Cores: 8
- router_cr (crystal)
- raze (crystal)
- japronto (python)
- fasthttprouter (go)
- nickel (rust)
- iron (rust)
- rocket (rust)
- kemal (crystal)
- echo (go)
- gorilla_mux (go)
- aspnetcore (csharp)
- iris (go)
- plug (elixir)
- phoenix (elixir)
- vapor (swift)
- perfect (swift)
- sanic (python)
- kitura (swift)
- akkahttp (scala)
- clusterexpress (node)
- express (node)
- roda (ruby)
- criollo (objc)
- sinatra (ruby)
- rails (ruby)
- crystal (router_cr)
- python (japronto)
- go (fasthttprouter)
- rust (nickel)
- csharp (aspnetcore)
- elixir (plug)
- swift (vapor)
- scala (akkahttp)
- node (clusterexpress)
- ruby (roda)
- objc (criollo)
Language (Runtime) | Framework (Middleware) | Max [sec] | Min [sec] | Avg [sec] |
---|---|---|---|---|
ruby | rails | 158.707613 | 157.559875 | 157.970116 |
ruby | sinatra | 44.278810 | 44.183649 | 44.252526 |
ruby | roda | 16.180626 | 16.132779 | 16.151732 |
crystal | kemal | 3.233941 | 3.054319 | 3.190098 |
crystal | router_cr | 2.432883 | 2.280620 | 2.318383 |
crystal | raze | 2.508283 | 2.407160 | 2.476729 |
go | echo | 3.798276 | 3.490771 | 3.592064 |
go | gorilla_mux | 3.897310 | 3.561739 | 3.726176 |
go | iris | 4.016436 | 3.507674 | 3.825695 |
go | fasthttprouter | 2.807106 | 2.716368 | 2.751400 |
rust | iron | 2.962235 | 2.717031 | 2.835935 |
rust | nickel | 2.856162 | 2.783444 | 2.834548 |
rust | rocket | 3.223768 | 3.153677 | 3.187345 |
node | express | 13.988441 | 13.727441 | 13.807823 |
node | clusterexpress | 8.088965 | 7.502522 | 7.720822 |
elixir | plug | 4.659650 | 4.258834 | 4.477080 |
elixir | phoenix | 4.999001 | 4.768156 | 4.844404 |
swift | vapor | 5.538846 | 5.314528 | 5.418623 |
swift | perfect | 5.833395 | 5.570222 | 5.668958 |
swift | kitura | 6.655281 | 6.476810 | 6.548700 |
scala | akkahttp | 8.692796 | 7.160795 | 7.619564 |
csharp | aspnetcore | 3.978898 | 3.616286 | 3.807356 |
python | sanic | 6.497731 | 5.388541 | 5.736287 |
python | japronto | 2.684628 | 2.553546 | 2.621803 |
objc | criollo | 34.808480 | 24.054073 | 27.575090 |
- Ruby
- Crystal
- Go
- Rust
- node
- Elixir
- Swift
- Scala
- C#
- Python
- Objective-C
See Development section when you want to add new languages or frameworks.
We want to know the response time (routing 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/benchmarker
For each language
> bin/benchmarker ruby
For each framework
> bin/benchmarker rails
For comparison (Comparing rails, kemal and router.cr in this example)
> bin/benchmarker rails crystal
If you take it manually, you can run each server by
> bin/server_[Language]_[Framework]
and run client by
> time bin/client
You 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 1000
In 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 rails
Then 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 listMakefile
neph.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