Recently i've been playing with an idea of really fast routes matching
and got 8.8x performance boost, implementing 90% of routing features
(comparing with ActionPack 2.0.2).
However, porting was a bit hard (not to say a real mess), so i've
applied a smaller optimisation (mostly sitting in a separate file,
what's really rocks) and got 2..3 times recognition speed boost for
vkadre.ru. In practice it means, that you can get up to 20-30% overall
performance improvement. Actual benefit depends on your app design,
for slow actions and/or tiny routes.rb it will be, of course, lower.
Here's a story about it (please read, there are important notes):
Here's the patch:
I'd like you to test the patch on your routes and report performance
characteristics before and after. (See a link to benchmark raketask
I hope, many guys would check this out and we get it applied into
trunk. Rails really deserves optimization in such kind of code.
Oleg Andreev (oleganza)
PS. Don't test it on a single pattern ":controller/:action/:id". It
does not improve speed in that case, but only adds a 30% overhead. Old
actionpack routing benchmark uses single pattern for recognition
testing, so it will show that things go slower rather than faster.