Rails routes and site performance

我的梦境 提交于 2020-01-04 04:03:40

问题


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:


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.




回答2:


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?



来源:https://stackoverflow.com/questions/3176202/rails-routes-and-site-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!