<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><description /><title>my.urgas.eu</title><generator>Tumblr (3.0; @urgas)</generator><link>http://my.urgas.eu/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/urgas" /><feedburner:info uri="urgas" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://tumblr.superfeedr.com/" /><item><title>Speeding up RSpec test suite: Tip #3</title><description>&lt;p&gt;Assuming you are using ruby 1.9.3-p0 at the moment, then I suggest applying funny-falcon patch (&lt;a href="https://gist.github.com/1688857"&gt;https://gist.github.com/1688857&lt;/a&gt;). This made my rails start up faster and also the overall runtime.&lt;/p&gt;
&lt;p&gt;This is also included in the RVM. To install it, just run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rvm get head
rvm install 1.9.3-falcon
rvm use 1.9.3-falcon&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also suggest adding following to your shell rc file (bonus section from the gist). This basically calms down the garbage collector. It has almost same effect as disabling GC completely in the specs (tip #2).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000&lt;/code&gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/urgas/~4/rIlBxk-JV6c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/urgas/~3/rIlBxk-JV6c/17447769258</link><guid isPermaLink="false">http://my.urgas.eu/post/17447769258</guid><pubDate>Sat, 11 Feb 2012 23:49:00 +0200</pubDate><category>rspec</category><category>performance</category><category>gc</category><category>patch</category><feedburner:origLink>http://my.urgas.eu/post/17447769258</feedburner:origLink></item><item><title>Speeding up RSpec test suite: Tip #2</title><description>&lt;p&gt;Got lots of RAM? Disable GC.&lt;/p&gt;
&lt;p&gt;I have this snippet in my spec_helper.rb&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;  if ENV["RUBY_DISABLE_GC_FOR_SPECS"]
    config.before(:suite) do
      puts "GC disabled"
      GC.disable
    end
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And in my shell rc file I have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export RUBY_DISABLE_GC_FOR_SPECS="true"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Warning: If you have many selenium tests, then do not disable it completely. You’ll just run out of RAM.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/urgas/~4/9u11yc_Mg9U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/urgas/~3/9u11yc_Mg9U/17446561260</link><guid isPermaLink="false">http://my.urgas.eu/post/17446561260</guid><pubDate>Sat, 11 Feb 2012 23:28:00 +0200</pubDate><category>rspec</category><category>performance</category><category>gc</category><feedburner:origLink>http://my.urgas.eu/post/17446561260</feedburner:origLink></item><item><title>Speeding up RSpec test suite: Tip #1</title><description>&lt;p&gt;If your test suite is database heavy and you are using postgresql, then turn off &lt;strong&gt;fsync&lt;/strong&gt; and &lt;strong&gt;synchronous_commit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;fsync&lt;/strong&gt; - &lt;em&gt;&lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; server will try to make           sure that updates are physically written to disk&lt;/em&gt; (&lt;a href="http://www.postgresql.org/docs/9.1/static/runtime-config-wal.html" title="link"&gt;link&lt;/a&gt;). In the development machine we usually don’t care about power failures and data loss, especially with the test data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;synchronous_commit&lt;/strong&gt; - &lt;em&gt;Specifies whether transaction commit will wait for WAL           records to be written to disk before the command returns           a &lt;span class="QUOTE"&gt;“success”&lt;/span&gt; indication to the           client &lt;/em&gt;(&lt;a href="http://www.postgresql.org/docs/9.1/static/wal-async-commit.html" title="link"&gt;link&lt;/a&gt;)&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You can change these settings in the postgresql.conf. Just set:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;fsync = off&lt;br/&gt;synchronous_commit = off&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;My test suite time with default options (using ssd): &lt;strong&gt;105&lt;/strong&gt; seconds.&lt;/p&gt;
&lt;p&gt;My test suite time with fsync and synchronous_commit turned off: &lt;strong&gt;30&lt;/strong&gt; seconds.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/urgas/~4/sq1idtJLfW0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/urgas/~3/sq1idtJLfW0/15839445061</link><guid isPermaLink="false">http://my.urgas.eu/post/15839445061</guid><pubDate>Sat, 14 Jan 2012 21:22:32 +0200</pubDate><category>rpsec</category><category>performance</category><category>postgresql</category><feedburner:origLink>http://my.urgas.eu/post/15839445061</feedburner:origLink></item></channel></rss>

