views:

62

answers:

2

I'm using Rails 3.0.1, HAML 0.3.22, and Mongrel 1.1.5 (and MongoMapper not AR). I'm rendering a list, and each list item is it's own partial. Every time the page renders one of the list item partials takes almost 100X longer to render (and it is an arbitrarily different one each time. Also, needless to say, each item has essentially the same data).

Any idea what is going on here? Should I move the logic into a block rather than a partial?

Rendered shared/_head.html.haml (5.6ms)
Rendered tasks/_incomplete_task.haml (6.2ms)
Rendered tasks/_incomplete_task.haml (6.4ms)
Rendered tasks/_incomplete_task.haml (6.9ms)
Rendered tasks/_incomplete_task.haml (6.2ms)
Rendered tasks/_incomplete_task.haml (6.0ms)
Rendered tasks/_incomplete_task.haml (6.1ms)
Rendered tasks/_incomplete_task.haml (6.4ms)
Rendered tasks/_incomplete_task.haml (6.2ms)
Rendered tasks/_incomplete_task.haml (7.0ms)
Rendered tasks/_incomplete_task.haml (531.6ms)
Rendered tasks/_incomplete_task.haml (8.0ms)
Rendered tasks/_incomplete_task.haml (6.8ms)
Rendered tasks/_incomplete_task.haml (6.5ms)
Rendered shared/_tasks.html.haml (633.0ms)
A: 

Maybe its faster if you put it into one single partial?

Lichtamberg
A: 

It could be the Ruby garbage collector.

Jeremy Weiskotten