I have a loop that renders a partial
1000.times do |i| render partial: \'test\', locals: {i: i} end
this is really slow, up to 0.1 ms for for
Use :collection option:
:collection
= render partial: 'test', collection: 10.times.to_a, as: :i
Docs: http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
Source: https://github.com/rails/rails/blob/master/actionview/lib/action_view/renderer/partial_renderer.rb#L284