Forum: Ruby on Rails QUESTION: Routing system scalability/best practices

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel A. (Guest)
on 2006-05-18 23:21
Hello,

I was wondering if people have a sense of the performance scalability of
the routing system, in the number of map.connect statements. Is
execution time (or memory usage) of routing any more than linear in the
number of map.connects? I figure I'd ask before trying to
reverse-engineer all the code generation... :)

On a related note, the reason I potentially have a lot of map.connects
is that I'd like my action names to be
fairly_descriptive_with_lots_of_underscores, whereas I want to keep my
URL forms much shorter. So I'm finding myself doing a lot of this sort
of thing:

map.connect 'mycontroller/dosomething/:id',
            :controller => 'my_controller',
            :action => 'very_descriptive_name_for_doing_something'

So much so that my routes.rb now consists of defining a bunch of hashes
mapping the real action names to URL shortened action names, followed by
map.connect statements within Hash.each blocks. I'm okay with
maintaining such a mapping, but I'm curious whether the seasoned routing
gurus have determined that this would be bad practice, and if so if
there are any alternative techniques out there.

Thanks,
Daniel
This topic is locked and can not be replied to.