0

I have some 'boxes' that use a javascript scrolling library to display content. The box contains 4 visible content nuggets like this:

<div class="item nugget lesson">
  <h3>
    <a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
      Authentic Jazz
    </a>
  </h3>
  <div class="thumb">
    <a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
      <img alt="22" src="http://common-resources.idance.net.s3.amazonaws.com/images/model_resources/dance_genres/thumb/22.jpg">
    </a>
  </div>
  History: Grounded in vintage videos, the modern revival of ...
  <br>
  <a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
    <img alt="Lesson_view" src="/images/objects/lesson_view.png?1276105734">
  </a>
</div>

When I render more than 50 of these partials, rails rendering load time is noticeable slow (over 2 seconds). I've optimized the sh*% out of my db queries and even added counter_cache fields, so that is not the slowdown.

I'm not talking about load in the browser, but rails processing time.

Please see load times here: http://pastebin.com/pSrNSSsF

Is this normal?

pixelearth
  • 13,674
  • 10
  • 62
  • 110
  • you could achieve partial load client side with tools like handlebars. It's just a matter of sending json to the view then – apneadiving Sep 04 '11 at 21:34
  • Well for one thing you seem to have external image dependencies. – Eric Sep 04 '11 at 22:31
  • @Eric: Wanted to clarify that I was referring to render time for the partial, not client side. I've edited my post to make that more clear. – pixelearth Sep 13 '11 at 05:48
  • I don't see any ERB there, are all of the partials comprised of static content? – Eric Sep 13 '11 at 18:35

1 Answers1

0

This is normal. You can try rendering a collection, for a bit of a performance gain. (Or cache.)

chug2k
  • 5,106
  • 2
  • 25
  • 30