# Routes.rb bad performance

**URL:** <https://www.ruby-forum.com/t/routes-rb-bad-performance/105156>\
**Category:** Rails\
**Created:** [May 26, 2007, 10:48am UTC](https://www.ruby-forum.com/t/routes-rb-bad-performance/105156 "2007-05-26T10:48:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 26, 2007, 10:48am UTC](https://www.ruby-forum.com/t/routes-rb-bad-performance/105156/1 "2007-05-26T10:48:41Z")

</div>

My config/routes.rb is about 200 lines.

I do some experiment with two different routes.rb,  
a) routes.rb with 200 lines, and  
b) routes.rb with only one line ( map.connect  
‘:controller/:action/:id’)

and the result,

a) takes 0.4s, and  
b) takes 1.7s

My routes.rb is not very complicated, just some string matching like  
map.connect ‘user/:username/home/:action/:id’ , :controller =\>  
‘user\_home’  
…  
but I really need those routes setting.

Any idea how to improve the performance?
