# Partials vs. Helpers

**URL:** <https://www.ruby-forum.com/t/partials-vs-helpers/109517>\
**Category:** Rails\
**Created:** [July 16, 2007, 9:53am UTC](https://www.ruby-forum.com/t/partials-vs-helpers/109517 "2007-07-16T09:53:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharkie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@sharkie](https://www.ruby-forum.com/u/sharkie)\
**Post date:** [July 16, 2007, 9:53am UTC](https://www.ruby-forum.com/t/partials-vs-helpers/109517/1 "2007-07-16T09:53:23Z")

</div>

I have several partials containing dynamic codes (already memcached all  
the fragments as best I could), which I reuse ( render :partial =\>  
“stuff.rhtml” ) a lot within a single action call. For example, I have a  
partial which defines how an entry is to be formated in HTML. I have 40  
entries on a page, so the partial is rendered 40 times in a single  
action.

Not knowing the innerworking of Rails, I have several questions.

1. Within that single action call, is the file \_stuff.rhtml read from  
the file system just once or 40 times?

2. Does the file \_stuff.rhtml gets compiled or cached somewhere? I am  
asking this because when I play with DRYML, it seems that its  
equivalence of partials get cached somehow.

3. If \_stuff.rhtml read from file system 40 times in the action call,  
should I rather convert this into a helper? Since, helper is cached?

Thanks!
