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
You could write that kemal needs ssl development headers to build (
libssl-dev
).Made some other benchmarks, put them in a docker. Gonna test rust frameworks someday.
https://github.com/wieczorek1990/benchmarks