<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PSA: The number of gems installed on your system can impact rails boot time</title>
	<atom:link href="http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/</link>
	<description>The act of making love, tenderly.</description>
	<lastBuildDate>Mon, 21 May 2012 21:22:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: raggi</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-157398</link>
		<dc:creator>raggi</dc:creator>
		<pubDate>Mon, 21 May 2012 21:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-157398</guid>
		<description>Gah, third comment..


It&#039;s also worth noting (potentially for future Rubygems patches), that RubyGems doesn&#039;t need whole gemspecs to do it&#039;s general work (for booting apps and such). In fact, on JIT&#039;d rubies, loading specs is quite a lot more expensive than doing some potential alternatives.

Consider for example, a simple data file containing: [name, version, dependencies, load_paths]

Make this datafile in simple data structures (e.g. tuples) and keep parsing cheap. Use a weakref cache and you&#039;ll be reasonably balanced, other than a small amount of GC fragmentation in the early slots (which is a problem now anyway - just dump ObjectSpace and see how much crap gets retained from gemspec loads and the like even after a bunch of GC runs).

Now crunch those indexes into a single file and maybe (if ruby-core adds mmap to stdlib) mmap it, suddenly all but the stat problem is largely solved.

Food for thought.</description>
		<content:encoded><![CDATA[<p>Gah, third comment..</p>
<p>It&#8217;s also worth noting (potentially for future Rubygems patches), that RubyGems doesn&#8217;t need whole gemspecs to do it&#8217;s general work (for booting apps and such). In fact, on JIT&#8217;d rubies, loading specs is quite a lot more expensive than doing some potential alternatives.</p>
<p>Consider for example, a simple data file containing: [name, version, dependencies, load_paths]</p>
<p>Make this datafile in simple data structures (e.g. tuples) and keep parsing cheap. Use a weakref cache and you&#8217;ll be reasonably balanced, other than a small amount of GC fragmentation in the early slots (which is a problem now anyway &#8211; just dump ObjectSpace and see how much crap gets retained from gemspec loads and the like even after a bunch of GC runs).</p>
<p>Now crunch those indexes into a single file and maybe (if ruby-core adds mmap to stdlib) mmap it, suddenly all but the stat problem is largely solved.</p>
<p>Food for thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raggi</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-157395</link>
		<dc:creator>raggi</dc:creator>
		<pubDate>Mon, 21 May 2012 21:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-157395</guid>
		<description>Ramdisk for OSX: https://gist.github.com/2764761</description>
		<content:encoded><![CDATA[<p>Ramdisk for OSX: <a href="https://gist.github.com/2764761" rel="nofollow">https://gist.github.com/2764761</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raggi</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-157394</link>
		<dc:creator>raggi</dc:creator>
		<pubDate>Mon, 21 May 2012 21:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-157394</guid>
		<description>Just to play devils advocate:

Folks who work on many different projects often spend more time waiting for &quot;bundle install&quot; than they do waiting for rails to boot.

I blogged about this issue many years ago, and it&#039;s still really difficult to solve. The problem is that stat(2) (and indeed almost every viable discovery method for filesystem paths) actually touches the disk, rather than just looking in the filesystem cache.

This can be avoided / solved a number of ways:

 * Run your app in a VM, as then even the stat(2) calls get cached
 * Run your app off of a ramdisk (because ramfs is much faster at stat(2) than even Sata-III and a big on-disk-cache)
 * Mount your app on an in-process stat-cached filesystem backed fusefs driver (no really, that can work fast, and relieve the need to remember to copy files back over to disk from a ramdisk).

There are some things we can do in RubyGems and Ruby to avoid the mad stat calls, but the best solution without changing the existing semantics will rely on Eric Hodels $LOAD_PATH object proposal in order to be cleanly implemented. Ideally, in order to mainain a reasonable time-space efficiency, we need a lightweight heap datastructure in the ruby stdlib that can represent the filesystem tree that RubyGems has installed, so we can walk that heap instead of smashing the filesystem all the time. This isn&#039;t flawless, but as stated (once you research it) it can be solved quite nicely with the $LOAD_PATH object. The issue with implementing it without, is that the load path is managed by more than just RubyGems (sadly), and this has real practical order limitations.

It&#039;s also worth noting though, that load path objects will be a semantic change that will break some popular libraries out there, so as with so many of these age old problems, we&#039;re in for a fun ride if we want to actually fix the root cause.

As for gemsets, once again, please people, realize that if you&#039;re going to install the same gems again and again and again, you may not actually be saving yourself time.</description>
		<content:encoded><![CDATA[<p>Just to play devils advocate:</p>
<p>Folks who work on many different projects often spend more time waiting for &#8220;bundle install&#8221; than they do waiting for rails to boot.</p>
<p>I blogged about this issue many years ago, and it&#8217;s still really difficult to solve. The problem is that stat(2) (and indeed almost every viable discovery method for filesystem paths) actually touches the disk, rather than just looking in the filesystem cache.</p>
<p>This can be avoided / solved a number of ways:</p>
<p> * Run your app in a VM, as then even the stat(2) calls get cached<br />
 * Run your app off of a ramdisk (because ramfs is much faster at stat(2) than even Sata-III and a big on-disk-cache)<br />
 * Mount your app on an in-process stat-cached filesystem backed fusefs driver (no really, that can work fast, and relieve the need to remember to copy files back over to disk from a ramdisk).</p>
<p>There are some things we can do in RubyGems and Ruby to avoid the mad stat calls, but the best solution without changing the existing semantics will rely on Eric Hodels $LOAD_PATH object proposal in order to be cleanly implemented. Ideally, in order to mainain a reasonable time-space efficiency, we need a lightweight heap datastructure in the ruby stdlib that can represent the filesystem tree that RubyGems has installed, so we can walk that heap instead of smashing the filesystem all the time. This isn&#8217;t flawless, but as stated (once you research it) it can be solved quite nicely with the $LOAD_PATH object. The issue with implementing it without, is that the load path is managed by more than just RubyGems (sadly), and this has real practical order limitations.</p>
<p>It&#8217;s also worth noting though, that load path objects will be a semantic change that will break some popular libraries out there, so as with so many of these age old problems, we&#8217;re in for a fun ride if we want to actually fix the root cause.</p>
<p>As for gemsets, once again, please people, realize that if you&#8217;re going to install the same gems again and again and again, you may not actually be saving yourself time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Myhrberg</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147645</link>
		<dc:creator>Jim Myhrberg</dc:creator>
		<pubDate>Fri, 02 Dec 2011 11:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147645</guid>
		<description>Personally I only install Bundler and a few other gems which provide command line utilities I use. The rest is handled with Bundler on a per-project basis.

I recently blogged about my setup here: http://jimeh.me/blog/2011/11/01/my-ruby-development-environment/</description>
		<content:encoded><![CDATA[<p>Personally I only install Bundler and a few other gems which provide command line utilities I use. The rest is handled with Bundler on a per-project basis.</p>
<p>I recently blogged about my setup here: <a href="http://jimeh.me/blog/2011/11/01/my-ruby-development-environment/" rel="nofollow">http://jimeh.me/blog/2011/11/01/my-ruby-development-environment/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Vit</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147596</link>
		<dc:creator>Andrew Vit</dc:creator>
		<pubDate>Fri, 02 Dec 2011 00:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147596</guid>
		<description>Really guys, why aren&#039;t ruby, rvm, rubygems, and bundler on speaking terms with each other to straighten this out?

Why is rubygems unaware of Gemfile? Shouldn&#039;t that be part of its domain?

Why do we still need &quot;bundle exec&quot; in front of everything? There was a proposal from RVM to manage that in the presence of a Gemfile, but it was rejected. (I think rbenv has a plugin to do that).

I know I&#039;m just ranting, but this whole gems thing shouldn&#039;t be so clumsy...</description>
		<content:encoded><![CDATA[<p>Really guys, why aren&#8217;t ruby, rvm, rubygems, and bundler on speaking terms with each other to straighten this out?</p>
<p>Why is rubygems unaware of Gemfile? Shouldn&#8217;t that be part of its domain?</p>
<p>Why do we still need &#8220;bundle exec&#8221; in front of everything? There was a proposal from RVM to manage that in the presence of a Gemfile, but it was rejected. (I think rbenv has a plugin to do that).</p>
<p>I know I&#8217;m just ranting, but this whole gems thing shouldn&#8217;t be so clumsy&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Hollis</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147527</link>
		<dc:creator>Ben Hollis</dc:creator>
		<pubDate>Thu, 01 Dec 2011 08:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147527</guid>
		<description>Would it make sense for RubyGems or Bundler to cache the mapping of require -&gt; gem path somewhere on disk so it wouldn&#039;t have to scan for them every time?</description>
		<content:encoded><![CDATA[<p>Would it make sense for RubyGems or Bundler to cache the mapping of require -&gt; gem path somewhere on disk so it wouldn&#8217;t have to scan for them every time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: na432151</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147509</link>
		<dc:creator>na432151</dc:creator>
		<pubDate>Thu, 01 Dec 2011 06:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147509</guid>
		<description>bundle clean --force (with bundler 1.1)</description>
		<content:encoded><![CDATA[<p>bundle clean &#8211;force (with bundler 1.1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Ma</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147499</link>
		<dc:creator>Patrick Ma</dc:creator>
		<pubDate>Thu, 01 Dec 2011 03:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147499</guid>
		<description>Or if you&#039;re on OSX:

gem list &#124; cut -f1 -d &quot; &quot; &#124; xargs gem uninstall -aIx</description>
		<content:encoded><![CDATA[<p>Or if you&#8217;re on OSX:</p>
<p>gem list | cut -f1 -d &#8221; &#8221; | xargs gem uninstall -aIx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikz</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147481</link>
		<dc:creator>mikz</dc:creator>
		<pubDate>Wed, 30 Nov 2011 23:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147481</guid>
		<description>Good point! Thanks. 

... creating clean gemsets for my apps! :)</description>
		<content:encoded><![CDATA[<p>Good point! Thanks. </p>
<p>&#8230; creating clean gemsets for my apps! <img src='http://tenderlovemaking.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Patterson</title>
		<link>http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time/comment-page-1/#comment-147480</link>
		<dc:creator>Aaron Patterson</dc:creator>
		<pubDate>Wed, 30 Nov 2011 23:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=574#comment-147480</guid>
		<description>@deepfryed no, that won&#039;t really help.  Just using the `bundle` bin stub will evaluate every gemspec on your system.</description>
		<content:encoded><![CDATA[<p>@deepfryed no, that won&#8217;t really help.  Just using the `bundle` bin stub will evaluate every gemspec on your system.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

