For example if looping over @feed, which renders a partial, you see the following in the log:
Rendered feeds/_feed_item.html.erb (2.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.6ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (2.8ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (2.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.8ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.6ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.2ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.6ms)
Is that a performance hit? Is there a better way to handle this so it doesn't output every time?
Thanks
Yes, it's a performance hit. Render a collection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With