title: Slow Rails Partials in Virtual Box With Shared Folders
body: <p>I'm building a Rails app using Virtual Box.  The code is in a shared folder on Windows and the Rails server runs in the VM.  I'm noticing a wicked performance drop rendering partials.  I'm rendering 250 rows into a table.  The inlined version of my code looks like this:</p>
  
  <pre><code>&lt;% activities.each do |activity| -%&gt;
    &lt;tr id="activity-&lt;%= activity.id -%&gt;-row"&gt;
      &lt;td&gt;&lt;%= activity.name -%&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;% end -%&gt;
  </code></pre>
  
  <p>The above code loads almost instantaneous in development mode.  When I turn the inner <code>&lt;tr&gt;</code> into a partial, everything breaks down.</p>
  
  <pre><code>&lt;% activities.each do |activity| -%&gt;
    &lt;%= render "row", activity: activity -%&gt;
  &lt;% end -%&gt;
  </code></pre>
  
  <p>Inside _row.html.erb I have</p>
  
  <pre><code>&lt;tr id="activity-&lt;%= activity.id -%&gt;-row"&gt;
    &lt;td&gt;&lt;%= activity.name -%&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>It now takes almost 60 seconds to load the page!</strong></p>
  
  <p>The console shows</p>
  
  <pre><code>  ...200+ previous render statements
    Rendered admin/org/activities/_row.html.erb (0.8ms)
    Rendered admin/org/activities/_row.html.erb (0.7ms)
    Rendered admin/org/activities/_row.html.erb (0.7ms)
    Rendered admin/org/activities/_row.html.erb (1.0ms)
    Rendered admin/org/activities/_row.html.erb (0.8ms)
    Rendered admin/org/activities/_row.html.erb (0.8ms)
    Rendered admin/org/activities/_row.html.erb (0.8ms)
    Rendered admin/org/activities/_activities.html.erb (57231.0ms)
  </code></pre>
  
  <p>I'm assuming this is a virtual box problem.  The console shows that each partial loads in .7ms to 1.6ms which suggests it's spending little time in Rails.  The last line of the console shows that it takes 57 seconds for the page to load, which is no where near the sum of the individual partial load times.</p>
  
  <p>Is there any way to speed this up, or is VirtualBox + shared folders a partial killer?</p>