[Rails] which is faster

0 views
Skip to first unread message

David Zhu

unread,
May 15, 2010, 7:58:36 PM5/15/10
to Ruby on Rails: Talk
Hey

Which options more faster for a rails app to access--

5 actions in 1 controller

or

5 controllers with 1 action in each

which one is the most optimal?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Iván Hernández Cazorla

unread,
May 15, 2010, 8:04:21 PM5/15/10
to rubyonra...@googlegroups.com
I think that the most optimal option is the second, 5 controllers with 1 action in each.

Think, one controller > one action
          one controller > one action > one fail

Greetings

2010/5/16 David Zhu <dzwestw...@gmail.com>



--
*Mi Twitter http://twitter.com/distriker
*Blog personal http://distriker.co.cc
*Fundador del proyecto IMGBeta
*Twitter oficial de IMGBeta http://twitter.com/imgbeta
*Webmaster del proyecto http://hispaturismo.com
*Webmaster de http://rincon-blogger.blogspot.com

Frederick Cheung

unread,
May 16, 2010, 5:56:18 AM5/16/10
to Ruby on Rails: Talk


On May 16, 1:58 am, David Zhu <dzwestwindso...@gmail.com> wrote:
> Hey
>
> Which options more faster for a rails app to access--
>
> 5 actions in 1 controller
>
> or
>
> 5 controllers with 1 action in each
>

I doubt makes any noticeable difference. Depending on the complexity
of the associated routes that might make a small difference, but this
really sounds like premature optimization to me. If you really must
know, benchmark it.

Fred

Ivan Nastyukhin

unread,
May 16, 2010, 5:58:18 AM5/16/10
to rubyonra...@googlegroups.com
I think, make code more readable, understanndable, and your api more near to rest. Because when u thinking about 0.00034 ms, u make stupid decision

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages