Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created April 16, 2009 21:11
Show Gist options
  • Save carllerche/96660 to your computer and use it in GitHub Desktop.
Save carllerche/96660 to your computer and use it in GitHub Desktop.
| rack-router | merb routing | rails routing |
--Route generation-----------------------------------------------------------------------------------------------------------------------------------
A simple string x10000 | 0.098 | 0.102 | 0.473 |
A simple string with query parameters x10000 | 0.277 | 0.353 | 0.630 |
A couple variable segments x10000 | 0.149 | 0.482 | 0.602 |
A lot of variable segments x10000 | 0.217 | 0.422 | 0.843 |
Conditions that matches x10000 | 0.190 | 0.317 | 0.700 |
Conditions that don't match x10000 | 0.745 | 0.908 | 1.698 |
A route with defaults while specifying all the parameters x10000 | 0.175 | 0.294 | 0.697 |
A route with defaults while specifying the last parameter x10000 | 0.171 | 0.378 | 0.641 |
A route with defaults while specifying the first parameter x10000 | 0.171 | 0.410 | 0.608 |
A route with defaults while specifying none of the parameters x10000 | 0.168 | 0.165 | 0.567 |
A route with optional segments given only the first parameter x10000 | 0.157 | 0.248 | 0.534 |
A route with optional segments given two sequential optional parameters x10000 | 0.166 | 0.270 | 0.858 |
A route with optional segments given two nested optional parameters x10000 | 0.163 | 0.309 | 0.540 |
A route with optional segments given two nested optional parameters and one sequential x10000 | 0.178 | 0.350 | 0.922 |
A route with optional segments given three nested optional parameters x10000 | 0.182 | 0.347 | 0.604 |
A route with optional segments given all the parameters x10000 | 0.239 | 0.374 | 0.721 |
A route with optionals & defaults while specifying all the parameters x10000 | 0.180 | 0.333 | 0.652 |
A route with optionals & defaults while specifying the last parameter x10000 | 0.185 | 0.419 | 0.653 |
A route with optionals & defaults while specifying the first parameter x10000 | 0.151 | 0.379 | 0.653 |
A route with optionals & defaults while specifying none of the parameters x10000 | 0.150 | 0.164 | |
All route generation (totals) | 4.111 | 7.022 | 13.597 |
| rack-router | merb routing | sinatra routing | rails routing |
--A 1352 route set with routes sequential at the top level-------------------------------------------------------------------------------
Matching the first route x1000 | 0.046 | 0.009 | 0.062 | 0.224 |
Matching the middle route x1000 | 0.047 | 0.110 | 0.527 | 1.389 |
Matching the last route x1000 | 0.050 | 0.334 | 1.109 | 3.549 |
| rack-router | merb routing | rails routing |
--A 1521 route set with routes nested evenly over method and 2 path levels deep-------------------------------------------------------------
Matching the first route x1000 | 0.053 | 0.010 | 0.074 |
Matching the middle route x1000 | 0.054 | 0.232 | 1.536 |
Matching the last route x1000 | 0.052 | 0.301 | 4.201 |
| rack-router | merb routing | rails routing |
--A 1521 route set with routes nested evenly 2 levels deep-------------------------------------------------------------
Matching the first route x1000 | 0.048 | 0.009 | 0.071 |
Matching the middle route x1000 | 0.049 | 0.213 | 1.456 |
Matching the last route x1000 | 0.048 | 0.224 | 4.019 |
A random route at the very end x1000 | 0.044 | 0.297 | 3.877 |
| rack-router | merb routing | sinatra routing | rails routing |
--A 20 route set with nothing nested-------------------------------------------------------------------------------
Matching the first route x4000 | 0.252 | 0.033 | 0.361 | 0.305 |
Matching the middle route x4000 | 0.225 | 0.077 | 0.338 | 0.341 |
Matching the last route x4000 | 0.258 | 0.044 | 0.338 | 0.402 |
| rack-router | merb routing | sinatra routing | rails routing |
--A 163 route set that isn't nested-------------------------------------------------------------------------------
Matching the first route x4000 | 0.249 | 0.033 | 0.361 | 0.224 |
Matching the middle route x4000 | 0.330 | 0.085 | 0.569 | 0.729 |
Matching the last route x4000 | 0.323 | 0.132 | 0.504 | 1.295 |
| rack-router | merb routing |
--Matching with optionals-------------------------------------------------
Matching /hello x10000 | 0.628 | 0.141 |
Matching /hello.js x10000 | 0.731 | 0.155 |
Matching /hello/world x10000 | 0.692 | 0.155 |
Matching /hello/world.js x10000 | 0.765 | 0.154 |
Matching /hello/world/10 x10000 | 0.760 | 0.153 |
Matching /hello/world/10.js x10000 | 0.792 | 0.164 |
| rack-router | merb routing | sinatra routing |
--Matching simple routes---------------------------------------------------------------
A string path x10000 | 0.585 | 0.082 | 0.834 |
A path with captures x10000 | 0.658 | 0.141 | 0.904 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment