r10k provides comparative benchmarks for many ruby web application frameworks with 10, 100, 1000, and 10,000 routes. Here are the currently supported frameworks:
Ruby on Rails (rubyonrails.org/)
These frameworks are designed to be run with the default settings. There are some variants that can be run with non-default settings:
A basic static routing implementation, for maximum performance
Hanami, using hanami-api gem
Rails, with most middleware removed
Roda, using the hash_routes plugins
Roda, using the multi_route plugin
Roda, using optimized_string_matchers plugin
Roda, using separate Roda applications per branch
Roda, using the static_routing plugin
Sinatra, using the minimum middleware
The frameworks that are tested by default are:
static-route syro roda cuba hanami rails sinatra rack-app watts
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.
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).
Check that the built apps return the expected values
Dimensions for the graphs (default: 1280x720)
The number of levels for the routes (default: 4)
Override base font size for legend text in graphs
Which applications/configurations to benchmark
The number of iterations to run (default: 2)
The number of threads to run (default: 1)
The number of warmup iterations to run (default: 0)
The number of routes in each level (default: 10)
Total number of routes in largest application is ROUTES_PER_LEVEL**LEVELS.
Jeremy Evans <firstname.lastname@example.org>