# Active Scaffold Performance

**URL:** <https://www.ruby-forum.com/t/active-scaffold-performance/178709>\
**Category:** Rails\
**Created:** [November 9, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/active-scaffold-performance/178709 "2009-11-09T21:02:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [November 9, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/active-scaffold-performance/178709/1 "2009-11-09T21:02:38Z")

</div>

Hi Everyone,

I know this is a recurring topic, but currently my application is  
running very slow and I would like to figure out why. Every  
transaction, except for the login page, have an average response time  
in the 8,000~ 14,000ms range (DB: 300ms range), which is absurd. I  
have implemented action caching and fragment caching on the views, but  
those only help when there is a cache hit. On a miss, it still takes  
8+ seconds to load.

I tried monitoring the application on new\_relic and found out that my  
view takes up for nearly 90% of the load time.  
Furthermore, I have ran ruby-prof on one of the slower transactions  
and found out that 65% of the transaction was from the method  
‘render\_without\_active\_scaffold’ which is part of the active\_scaffold  
plugin. I suspect the fact that the transaction calls  
‘render :partial’ 45 times doesn’t help much, but the application is  
pretty complex, and those 45 partial renderings are quite necessary.

I’ve searched on google to see if anybody else had problems with  
activescaffold, but that doesn’t seem to be the case…

Some things I’ve tried

- Replace helper methods in the views with the html they produce.
- Caching (action, fragment)
- Eager loading (although DB query times are in the 300ms range)

Does anybody have any idea why ‘render\_without\_active\_scaffold’ or any  
other rails function (like render partial) would take so long?

Is it because my application is running on a VM?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [November 9, 2009, 9:29pm UTC](https://www.ruby-forum.com/t/active-scaffold-performance/178709/2 "2009-11-09T21:29:12Z")

</div>

ken wrote:

> Does anybody have any idea why ‘render\_without\_active\_scaffold’ or any  
> other rails function (like render partial) would take so long?
> 
> Is it because my application is running on a VM?
> 
> Thanks in advance!

When you installed active\_scaffold, is used a method  
Molule::alias\_method\_chain to branch off the render method.

The new functionality that active\_scaffold provided was named  
render\_with\_active\_scaffold

and the EXISTING one was renamed to: render\_without\_active\_scaffold.

So in effect, when you see the “without” version in your call stack, it  
means you are using the version prior to when you installed  
active\_scaffold. This will lead you to the conclusion that your  
bottleneck IS NOT with active\_scaffold…

hth

ilan
