Measuring response times (routing times) for each framework (middleware). Each framework has to have two features; routing and parsing path parameters.
Last update: 2018-01-10
OS: Darwin (version: 17.2.0, arch: x86_64)
CPU Cores: 8
- router_cr (crystal)
- raze (crystal)
- nickel (rust)
- japronto (python)
- iron (rust)
- fasthttprouter (go)
- kemal (crystal)
- rocket (rust)
- aspnetcore (csharp)
- gorilla_mux (go)
- iris (go)
- echo (go)
- plug (elixir)
- phoenix (elixir)
- vapor (swift)
- perfect (swift)
- sanic (python)
- kitura (swift)
- clusterexpress (node)
- akkahttp (scala)
- express (node)
- roda (ruby)
- criollo (objc)
- sinatra (ruby)
- rails (ruby)
- crystal (router_cr)
- rust (nickel)
- python (japronto)
- go (fasthttprouter)
- csharp (aspnetcore)
- elixir (plug)
- swift (vapor)
- node (clusterexpress)
- scala (akkahttp)
- ruby (roda)
- objc (criollo)
| Language (Runtime) | Framework (Middleware) | Max [sec] | Min [sec] | Ave [sec] |
|---|---|---|---|---|
| ruby | rails | 161.079991 | 160.341164 | 160.664641 |
| ruby | sinatra | 45.534552 | 45.326070 | 45.378119 |
| ruby | roda | 16.244110 | 16.204136 | 16.220350 |
| crystal | kemal | 3.292682 | 3.157299 | 3.252980 |
| crystal | router_cr | 2.552623 | 2.471256 | 2.516766 |
| crystal | raze | 2.777100 | 2.665155 | 2.735574 |
| go | echo | 4.159959 | 4.011258 | 4.077308 |
| go | gorilla_mux | 4.170352 | 3.909323 | 4.036364 |
| go | iris | 4.348133 | 3.864387 | 4.073871 |
| go | fasthttprouter | 3.016682 | 2.886777 | 2.962532 |
| rust | iron | 3.023135 | 2.837906 | 2.918141 |
| rust | nickel | 2.818330 | 2.780301 | 2.803500 |
| rust | rocket | 3.556692 | 3.363295 | 3.426910 |
| node | express | 12.429907 | 11.482538 | 11.783619 |
| node | clusterexpress | 7.884909 | 6.594599 | 6.911125 |
| elixir | plug | 4.654937 | 4.269527 | 4.546351 |
| elixir | phoenix | 4.933707 | 4.788846 | 4.854297 |
| swift | vapor | 5.561565 | 5.325290 | 5.412418 |
| swift | perfect | 5.634706 | 5.352592 | 5.545727 |
| swift | kitura | 6.652122 | 6.514098 | 6.582017 |
| scala | akkahttp | 9.114887 | 7.183424 | 7.819570 |
| csharp | aspnetcore | 4.099906 | 3.747440 | 3.849951 |
| python | sanic | 6.438378 | 5.505323 | 5.748179 |
| python | japronto | 2.857492 | 2.797253 | 2.827124 |
| objc | criollo | 34.878167 | 23.799794 | 26.548463 |
- 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/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
