This is just for demonstration purpose. A simple app just returning "Hello World". First in Kemal (Crystal) and then in Sinatra(Ruby with thin).
Kemal Version: 0.6.0 Crystal Version: 0.10.0
# app.cr
require "kemal"
get "/" do
"Hello World!"
end
Sinatra Version: 1.4.6 Ruby Version: 2.2.2p95 Thin Version: 1.6.4
# app.rb
require "sinatra"
set :environment, :production
set :server, %w[thin]
get "/" do
"Hello World!"
end
wrk
is used to run this benchmark with 100 connections.
To run Kemal: crystal build --release src/app.cr && ./app
To run Sinatra: ruby app.rb -p 3000
Finally to run benchmark:
wrk -c 100 -d 20 http://localhost:3000
So I did it in Flask on uwsgi and it's only slightly better than Sinatra:
Installing:
Running:
Code:
Results on my Dell Vostro:
I'll try the same with Rails API later.