Skip to content
Comparative ruby web application benchmarks with a large number of routes
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
builders Add a roda-hash-routes builder for testing roda with the hash-routes … Apr 3, 2019
.gitignore Split large_apps into separate file per app for ease of maintenance Jan 15, 2015
MIT-LICENSE Bump copyright year Feb 17, 2016
README.rdoc Remove the Gemfile Oct 3, 2019
Rakefile Drop testing of synfeld and nyny by default, test watts by default Oct 3, 2019
benchmarker.rb Support R10K_NUM_THREADS environment variable for multiple threads du… May 30, 2018
builder.rb
config.ru Initial commit Sep 30, 2014

README.rdoc

r10k

r10k provides comparative benchmarks for many ruby web application frameworks with 10, 100, 1000, and 10,000 routes. Here are the currently supported frameworks:

cuba

Cuba (cuba.is)

hanami

Hanami (hanamirb.org/)

nyny

NYNY (github.com/alisnic/nyny)

rack-app

Rack::App (github.com/rack-app/rack-app)

rails

Ruby on Rails (rubyonrails.org/)

roda

Roda (roda.jeremyevans.net)

sinatra

Sinatra (www.sinatrarb.com/)

syro

Syro (soveran.github.io/syro/)

synfeld

Synfeld (github.com/swerling/synfeld)

watts

Watts (github.com/pete/watts)

These frameworks are designed to be run with the default settings. There are some variants that can be run with non-default settings:

static-route

A basic static routing implementation, for maximum performance

rails-minimal-middleware

Rails, with most middleware removed

roda-hash-routes

Roda, using the hash_routes plugins

roda-multi-route

Roda, using the multi_route plugin

roda-osm

Roda, using optimized_string_matchers plugin

roda-run

Roda, using separate Roda applications per branch

roda-static-routing

Roda, using the static_routing plugin

sinatra-minimal-middleware

Sinatra, using the minimum middleware

The frameworks that are tested by default are:

static-route syro roda cuba hanami rails sinatra rack-app watts

Installation

After cloning the repository, install the related gems:

gem install gruff # if you want to create the graphs
gem install roda sinatra rails cuba syro hanami # frameworks to test

A Gemfile is not used, because all webframeworks are tested independently, and with a Gemfile, bundler assumes all gems must be able to work together.

Usage

To use:

rake bench graphs

Note that rake bench can take quite a long time, especially on slower hardware.

If you only want to benchmark specific apps, set the R10K_APPS environment variable:

rake bench graphs R10K_APPS="roda cuba"

The builders directory contains the files that build the applications. If you want to examine the application files used for benchmarking, you can use the build task and then look in the apps directory. The bench task produces CSV files which are stored in the data directory. The graphs task takes those CSV files and turns them into nice looking graphs (using gruff).

Environment variables:

CHECK

Check that the built apps return the expected values

DIM

Dimensions for the graphs (default: 1280x720)

LEVELS

The number of levels for the routes (default: 4)

LEGEND_FONT_SIZE

Override base font size for legend text in graphs

R10K_APPS

Which applications/configurations to benchmark

R10K_ITERATIONS

The number of iterations to run (default: 2)

R10K_NUM_THREADS

The number of threads to run (default: 1)

R10K_WARMUP_ITERATIONS

The number of warmup iterations to run (default: 0)

ROUTES_PER_LEVEL

The number of routes in each level (default: 10)

Total number of routes in largest application is ROUTES_PER_LEVEL**LEVELS.

License

MIT

Author

Jeremy Evans <code@jeremyevans.net>

You can’t perform that action at this time.