Which is the fastest?
Result
How to run server
bin/server_rails # for rails
bin/server_kemal # for Kemal
bin/server_route_cr # for route.cr
How to run client
time bin/client -t 16 -r 1000 # 48000 requests in total
time bin/client -t 16 -r 2000 # 96000 requests in total
time bin/client -t 16 -r 3000 # 144000 requests in total
time bin/client -t 16 -r 4000 # 192000 requests in total
time bin/client -t 16 -r 5000 # 240000 requests in total
Regulation and Rule
- Each server has no logics
- 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
Installation
You need
- crystal
- rails
To compile servers,
> make
Usage
To run server
./bin/server_rails
./bin/server_kemal
./bin/server_route_cr
To run client
time ./bin/client
You can set # of threads and # of request loops(each loop requests 3 times) 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.
Thanks for
Development
- Give me PR when you want to add other web frameworks
- Give me PR when you can tuning each framework (under the regulation)
Contributing
- 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
Contributors
- tbrand Taichiro Suzuki - creator, maintainer