# Which is faster

**URL:** <https://www.ruby-forum.com/t/which-is-faster/188671>\
**Category:** Rails\
**Created:** [May 16, 2010, 2:00am UTC](https://www.ruby-forum.com/t/which-is-faster/188671 "2010-05-16T02:00:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 16, 2010, 2:00am UTC](https://www.ruby-forum.com/t/which-is-faster/188671/1 "2010-05-16T02:00:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 16, 2010, 11:56am UTC](https://www.ruby-forum.com/t/which-is-faster/188671/2 "2010-05-16T11:56:31Z")

</div>

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 Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> which one is the most optimal?

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

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 16, 2010, 11:57am UTC](https://www.ruby-forum.com/t/which-is-faster/188671/3 "2010-05-16T11:57:42Z")

</div>

On May 16, 1:58 am, David Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 16, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/which-is-faster/188671/4 "2010-05-16T12:15:51Z")

</div>

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

On 16.05.2010, at 4:04, IvÃ¡n HernÃ¡ndez Cazorla  
\<ivanhcelrinconelmejor@gmail.c
