views:

36

answers:

2

Is there a direct correlation on site speed with the number of namespaces / routes in the routes.rb file of a Rails Application?

I am handling a fairly large application with more than 30 disparate models/entities and most of these resources have their own routes.

+1  A: 

the number of routes will affect the memory overhead - it's why rails no longer defines formatted routes out the box: http://ryandaigle.com/articles/2008/11/27/what-s-new-in-edge-rails-no-more-formatted-routes

It's not unusual to have 30 or so routes though

As for whether or not this will affect the speed of your app, it's difficult to say - are you using metric-fu or anything like that?

stephenmurdoch
metric-fu, well not yet. I am at the initial stages and trying to get to a semi-optimal design before I start iterating. I suppose metric-fu will come handy when I have a decent codebase?
papdel
A: 

I don't have a citation† but DHH recently said that 37signals' Highrise application has thousands of routes, so it is possible to scale the routes if you have a big enough box to run your application on.

† I think it may have been during his recent RailsConf keynote, when he was talking about the new router API in Rails 3.

John Topley