<?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: How slow are (Ruby) Exceptions?</title>
	<atom:link href="http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/</link>
	<description>Simone Carletti&#039;s personal ramblings on programming, syndication, search engines &#38; marketing.</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:24:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Métodos que retornam mais de um valor em Ruby &#124; Prodis a.k.a. Fernando Hamasaki de Amorim</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-8950</link>
		<dc:creator>Métodos que retornam mais de um valor em Ruby &#124; Prodis a.k.a. Fernando Hamasaki de Amorim</dc:creator>
		<pubDate>Sat, 20 Feb 2010 19:53:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-8950</guid>
		<description>[...] Ele indicou um post falando a respeito:  http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions [...]</description>
		<content:encoded><![CDATA[<p>[...] Ele indicou um post falando a respeito:  <a href="http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions" rel="nofollow">http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Caffeine Driven Development &#187; Blog Archive &#187; L33t Links #68</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7895</link>
		<dc:creator>Caffeine Driven Development &#187; Blog Archive &#187; L33t Links #68</dc:creator>
		<pubDate>Fri, 15 Jan 2010 09:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7895</guid>
		<description>[...] How slow are (Ruby) Exceptions? [...]</description>
		<content:encoded><![CDATA[<p>[...] How slow are (Ruby) Exceptions? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Cooper</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7843</link>
		<dc:creator>Peter Cooper</dc:creator>
		<pubDate>Wed, 13 Jan 2010 16:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7843</guid>
		<description>A key finding from this benchmark, IMHO, is that exceptions do not slow things down when they&#039;re not raised. That is, having the rescue mechanism in place does not seem to slow down properly working code by any serious degree.. it&#039;s only when exceptions are actually raised that they&#039;re &quot;slow.&quot;

I agree with Thorsten Böttger. Since exceptions are not/should not be part of ordinary flow - hence their name - I don&#039;t see their lack of performance as motivation for not using them in places where they really are &quot;exceptional.&quot; Just in case anyone gets the wrong idea from these findings.. ;-)</description>
		<content:encoded><![CDATA[<p>A key finding from this benchmark, IMHO, is that exceptions do not slow things down when they&#8217;re not raised. That is, having the rescue mechanism in place does not seem to slow down properly working code by any serious degree.. it&#8217;s only when exceptions are actually raised that they&#8217;re &#8220;slow.&#8221;</p>
<p>I agree with Thorsten Böttger. Since exceptions are not/should not be part of ordinary flow &#8211; hence their name &#8211; I don&#8217;t see their lack of performance as motivation for not using them in places where they really are &#8220;exceptional.&#8221; Just in case anyone gets the wrong idea from these findings.. ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone Carletti</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7834</link>
		<dc:creator>Simone Carletti</dc:creator>
		<pubDate>Wed, 13 Jan 2010 14:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7834</guid>
		<description>Indeed, it depends on the specific code.

The example posted above was a simplification of the original code, where I actually saved up to 10 hours per 900K records just refactoring the logic in order to avoid exceptions.

You can write as many benchmarks as you wish, but you won&#039;t be able to determine whether skipping Exception means to be x2, x4 or xN times faster.

Here&#039;s an other example.
http://gist.github.com/275768#file_if_vs_exception_vs_regexp_zerodivision.rb

Here the difference is smaller compared to the original benchmark also because the execution stack is smaller resulting in a more lightweight script.

However, we all agree that exceptions cost. ;)</description>
		<content:encoded><![CDATA[<p>Indeed, it depends on the specific code.</p>
<p>The example posted above was a simplification of the original code, where I actually saved up to 10 hours per 900K records just refactoring the logic in order to avoid exceptions.</p>
<p>You can write as many benchmarks as you wish, but you won&#8217;t be able to determine whether skipping Exception means to be x2, x4 or xN times faster.</p>
<p>Here&#8217;s an other example.<br />
<a href="http://gist.github.com/275768#file_if_vs_exception_vs_regexp_zerodivision.rb" rel="nofollow">http://gist.github.com/275768#file_if_vs_exception_vs_regexp_zerodivision.rb</a></p>
<p>Here the difference is smaller compared to the original benchmark also because the execution stack is smaller resulting in a more lightweight script.</p>
<p>However, we all agree that exceptions cost. ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Summers</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7833</link>
		<dc:creator>Curtis Summers</dc:creator>
		<pubDate>Wed, 13 Jan 2010 14:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7833</guid>
		<description>In fact, it&#039;s very likely that circumventing the call to IPSocket.getaddress is the majority of the time difference for this example.</description>
		<content:encoded><![CDATA[<p>In fact, it&#8217;s very likely that circumventing the call to IPSocket.getaddress is the majority of the time difference for this example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Summers</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7832</link>
		<dc:creator>Curtis Summers</dc:creator>
		<pubDate>Wed, 13 Jan 2010 14:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7832</guid>
		<description>Yes, exceptions are slow, but this is not a good example.  There&#039;s quite a bit more logic in IPAddr#initialize, and this example is simply circumventing all of that additional code:

http://ruby-doc.org/core/classes/IPAddr.src/M000734.html</description>
		<content:encoded><![CDATA[<p>Yes, exceptions are slow, but this is not a good example.  There&#8217;s quite a bit more logic in IPAddr#initialize, and this example is simply circumventing all of that additional code:</p>
<p><a href="http://ruby-doc.org/core/classes/IPAddr.src/M000734.html" rel="nofollow">http://ruby-doc.org/core/classes/IPAddr.src/M000734.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone Carletti</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7831</link>
		<dc:creator>Simone Carletti</dc:creator>
		<pubDate>Wed, 13 Jan 2010 13:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7831</guid>
		<description>Thanks Vladimir!

I was planning to run the benchmarks on JRuby. This is a really interesting comparison, thank you for posting here the results.</description>
		<content:encoded><![CDATA[<p>Thanks Vladimir!</p>
<p>I was planning to run the benchmarks on JRuby. This is a really interesting comparison, thank you for posting here the results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Sizikov</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7830</link>
		<dc:creator>Vladimir Sizikov</dc:creator>
		<pubDate>Wed, 13 Jan 2010 13:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7830</guid>
		<description>Interestingly, on JRuby, the difference is much, much smaller: 2sec vs 1.5sec.</description>
		<content:encoded><![CDATA[<p>Interestingly, on JRuby, the difference is much, much smaller: 2sec vs 1.5sec.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thorsten Böttger</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comment-7822</link>
		<dc:creator>Thorsten Böttger</dc:creator>
		<pubDate>Wed, 13 Jan 2010 09:57:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915#comment-7822</guid>
		<description>What&#039;s the problem with slow exceptions? Exceptions are not part of the normal control flow, and are by definition unexpected. Thus, nobody expects outstanding performance for exceptions…</description>
		<content:encoded><![CDATA[<p>What&#8217;s the problem with slow exceptions? Exceptions are not part of the normal control flow, and are by definition unexpected. Thus, nobody expects outstanding performance for exceptions…</p>
]]></content:encoded>
	</item>
</channel>
</rss>

