<?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:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Methodmissing</title>
	
	<link>http://blog.methodmissing.com</link>
	<description>Ruby MRI, dtrace, misc. ruby hacks etc.</description>
	<lastBuildDate>Mon, 07 Dec 2009 08:57:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/methodmissing" /><feedburner:info uri="methodmissing" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Dynamic Language VMs – Inside Ruby</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/SaU-sblt3qI/</link>
		<comments>http://blog.methodmissing.com/2009/12/06/dynamic-language-vms-inside-ruby/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 22:56:42 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[MRI Internals]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[dtrace]]></category>
		<category><![CDATA[ruby rails vm ast abstract syntax tree runtime instruction sequence gc garbage collection symbol table]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=74</guid>
		<description><![CDATA[I had the opportunity to present at SAPO Codebits this weekend, covering Ruby and scripting VMs in general.
See the session abstract for further details before digging into the slides below.
Dynamic Language VMs &#8211; Inside Ruby (Sapo Codebits 2009)
View more documents from Lourens Naudé.

I&#8217;d also like to take a moment and state what a great experience [...]]]></description>
			<content:encoded><![CDATA[<p>I had the opportunity to present at <a href="http://www.codebits.eu">SAPO Codebits</a> this weekend, covering Ruby and scripting VMs in general.</p>
<p>See the <a href="http://codebits.eu/intra/s/session/58">session abstract</a> for further details before digging into the slides below.</p>
<div id="__ss_2648919" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Dynamic Language VMs - Inside Ruby (Sapo Codebits 2009)" href="http://www.slideshare.net/methodmissing/inside-ruby-sapo-codebits-2009">Dynamic Language VMs &#8211; Inside Ruby (Sapo Codebits 2009)</a><object width="425" height="355" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cb-091204071125-phpapp01&amp;stripped_title=inside-ruby-sapo-codebits-2009" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cb-091204071125-phpapp01&amp;stripped_title=inside-ruby-sapo-codebits-2009" /><param name="allowfullscreen" value="true" /></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/methodmissing">Lourens Naudé</a>.</div>
</div>
<p>I&#8217;d also like to take a moment and state what a great experience the different tracks, venue, organization, catering, Internet access and entertainment bits was.Well on par, if not beyond, the vast majority of international conferences out there.</p>
<p>At no cost (free, grátis, gratis, gratuit) to attendees.</p>
<p>Bean bags, hammocks, work spaces, huge ass presentation areas, dedicated sound / camera crews,  quizzes, projects, soldering workstations and a constant pizza and red bull supply.</p>
<p>A great reflection of the innovation at work inside <a href="http://www.sapo.pt">SAPO</a> and a peek into emerging technologies being rolled out.</p>
<p>I&#8217;ll dedicate a few blog posts to cover some Ruby VM sections in detail during the next few weeks if there&#8217;s sufficient demand &#8211; please leave a comment if that appeals to you.</p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/SaU-sblt3qI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/12/06/dynamic-language-vms-inside-ruby/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/12/06/dynamic-language-vms-inside-ruby/</feedburner:origLink></item>
		<item>
		<title>POSIX Realtime and Events presentation</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/-qgwiAcP2IQ/</link>
		<comments>http://blog.methodmissing.com/2009/09/12/posix-realtime-and-events-presentation/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 17:50:17 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[Evented Programming]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[posix realtime presentation ruby threads fiber io reactor]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=72</guid>
		<description><![CDATA[Presented today at Barcamp PT.Enjoy!
Barcamp PT
View more documents from methodmissing.

Follow me @ github or twitter if you enjoyed this presentation.
]]></description>
			<content:encoded><![CDATA[<p>Presented today at <a href="http://barcamppt.org/wiki/index.php/Setembro09">Barcamp PT</a>.Enjoy!</p>
<div style="width:425px;text-align:left" id="__ss_1989048"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/methodmissing/barcamp-pt" title="Barcamp PT">Barcamp PT</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=barcamp-090912124500-phpapp01&#038;stripped_title=barcamp-pt" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=barcamp-090912124500-phpapp01&#038;stripped_title=barcamp-pt" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/methodmissing">methodmissing</a>.</div>
</div>
<p>Follow me @ <a href="http://github.com/methodmissing">github</a> or <a href="http://twitter.com/methodmissing">twitter</a> if you enjoyed this presentation.</p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/-qgwiAcP2IQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/09/12/posix-realtime-and-events-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/09/12/posix-realtime-and-events-presentation/</feedburner:origLink></item>
		<item>
		<title>Alternative HashWithIndifferentAccess</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/DyyUoeT0HhY/</link>
		<comments>http://blog.methodmissing.com/2009/08/29/alternative-hashwithindifferentaccess/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 00:32:54 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[MRI Internals]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[hash mri ruby st symbol table hash with indifferent access rack rails]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=59</guid>
		<description><![CDATA[After having revisited ActiveSupport a few weeks ago to investigate Hash#reverse_merge!, I noticed ActiveSupport::HashWithIndifferentAccess.Excessive object allocation and branching in the critical path scratched an itch and spawned hwia.
Ruby hashes and the symbol table
MRI ships with a generic hash table for storage of variables, methods, class inheritance chains and the like.Please head off to an excellent [...]]]></description>
			<content:encoded><![CDATA[<p>After having revisited ActiveSupport a few weeks ago to investigate Hash#reverse_merge!, I noticed ActiveSupport::HashWithIndifferentAccess.Excessive object allocation and branching in the critical path scratched an itch and spawned <a href="http://github.com/methodmissing/hwia/tree/master">hwia</a>.</p>
<h2>Ruby hashes and the symbol table</h2>
<p>MRI ships with a generic hash table for storage of variables, methods, class inheritance chains and the like.Please head off to an excellent <a href="http://jakedouglas.net/2009/06/stc-a-fast-hash-table-for-mri-extensions-and-beyond/">overview</a> on this subject by <a href="http://jakedouglas.net">Jake Douglas</a> and please do come back.</p>
<p><script src="http://gist.github.com/177766.js"></script></p>
<p>Hashes is tightly coupled with the symbol table implementation and as such requires a comparison (2 values as arguments) function</p>
<p><script src="http://gist.github.com/177752.js"></script></p>
<p>as well as a hashing function for each value (single argument)</p>
<p><script src="http://gist.github.com/177755.js"></script></p>
<p>A new object hash structure wraps the hash callback functions and is assigned as the hash type to the symbol table that represent the hash object.</p>
<p><script src="http://gist.github.com/177760.js"></script></p>
<h2>Hashing symbols and strings</h2>
<p>Symbols and strings are somewhat interchangeable at a lower level and conversion between either is relatively snappy.We extract a strhash function ( leeched from st.c ) and define</p>
<p><code><br />
String#strhash<br />
Symbol#strhash # thanks raggi!<br />
'key'.strhash == :key.strhash #=> true<br />
</code></p>
<p><script src="http://gist.github.com/177768.js"></script></p>
<p>We also now need to define new hash and comparison functions to take advantage of this feature.Apologies for the fugly 1.8 / 1.9 conditionals.</p>
<p><script src="http://gist.github.com/177771.js"></script> </p>
<p>and let the symbol table that powers our string like hash call them </p>
<p><script src="http://gist.github.com/177776.js"></script></p>
<h2>Conversion and coercion</h2>
<p>Special case handling for certain value assignments is required for the most prolific use case, that of representing request parameters, in a possibly nested fashion.</p>
<ul>
<li><strong>Hash</strong> converts to StrHash</li>
<li><strong>Array</strong> converts Hash elements to StrHash</li>
</ul>
<p><script src="http://gist.github.com/177779.js"></script></p>
<h2>Installation</h2>
<p><code><br />
sudo gem install methodmissing-hwia<br />
'require "hwia_rails"' # from within an initializer<br />
</code></p>
<p>This extension is compatible with MRI > 1.8.6 &#038;&#038; 1.9.2 and Rails > 2.3.x</p>
<h2>Examples</h2>
<p>The Rails compatibility layer &#8230;</p>
<p><code><br />
methodmissing:~ lourens$ irb<br />
>> require 'rubygems'<br />
=> true<br />
>> require 'hwia_rails'<br />
LoadError: Rails environment required!<br />
	from /opt/local/lib/ruby/gems/1.8/gems/hwia-1.0.0/lib/hwia_rails.rb:2<br />
	from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'<br />
	from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'<br />
	from (irb):2<br />
>> require 'activesupport'<br />
=> true<br />
>> require 'hwia_rails'<br />
=> []<br />
>> HashWithIndifferentAccess<br />
=> StrHash<br />
</code></p>
<p>&#8230; basic usage</p>
<p><code><br />
methodmissing:~ lourens$ irb<br />
>> require 'rubygems'<br />
=> true<br />
>> require 'hwia'<br />
=> true<br />
>> h = StrHash[:a  => 1, 'b' => 2]<br />
=> {:a=>1, "b"=>2}<br />
>> h[:a]<br />
=> 1<br />
>> h['a']<br />
=> 1<br />
>> h[:b]<br />
=> 2<br />
>> h.class<br />
=> StrHash<br />
>> h = { 'a' => 1, 'b' => 2 }<br />
=> {"a"=>1, "b"=>2}<br />
>> h = h.strhash<br />
=> {"a"=>1, "b"=>2}<br />
>> h[:a]<br />
=> 1<br />
>> h[:b]<br />
=> 2<br />
</code></p>
<p>This implementation is compatible with the current (30/08/2009) Rails master branch&#8217;s test suite.Please refer to the test cases of either project for further examples. </p>
<h2>Performance</h2>
<p>Benchmarks available from the <a href="http://github.com/methodmissing/hwia/tree/master">README</a>.</p>
<p>You&#8217;d notice very little, if any, performance improvements using this extension in the request / response cycle for the vast majority of apps.HashWithIndifferentAccess is limited to query params and ActiveRecord nested attributes assignment.</p>
<p>Consider this a step towards an extraction of a query param object, reusable across many different frameworks and projects.</p>
<p>Follow me @ <a href="http://github.com/methodmissing">github</a> or <a href="http://twitter.com/methodmissing">twitter</a> if you enjoyed this article.Thanks for reading!</p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/DyyUoeT0HhY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/08/29/alternative-hashwithindifferentaccess/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/08/29/alternative-hashwithindifferentaccess/</feedburner:origLink></item>
		<item>
		<title>Native MRI Callback</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/MPMyV0bExZw/</link>
		<comments>http://blog.methodmissing.com/2009/08/22/native-mri-callback/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 18:47:18 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[MRI Internals]]></category>
		<category><![CDATA[mri callback ruby gc struct alloc]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=50</guid>
		<description><![CDATA[A few weeks ago after a discussion with raggi (yet again) about callback implementations for the Ruby language, we kicked off an attempt at a minimal native object that&#8217;s very close in performance to method dispatch. 
Here&#8217;s a representation of the pure ruby version :

The game plan
The following inefficiencies would have to be addressed :

Instance [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago after a discussion with <a href="http://github.com/raggi">raggi</a> (yet again) about callback implementations for the Ruby language, we kicked off an attempt at a minimal native object that&#8217;s very close in performance to method dispatch. </p>
<p>Here&#8217;s a representation of the pure ruby version :</p>
<p><script src="http://gist.github.com/172884.js"></script></p>
<h2>The game plan</h2>
<p>The following inefficiencies would have to be addressed :</p>
<ul>
<li><strong>Instance variables</strong> Instance variable lookups in general require some symbol table overhead.</li>
<li><strong>Block procedure arguments</strong> Block proc arguments are up to 6x slower than passing explicit objects.</li>
<li><strong>Method dispatch</strong> The splat operator and __send__, although efficient, does have some noticeable overheads.</li>
<li><strong>Kernel convenience method</strong></li>
<p> Additional method dispatch in the critical path through this global function.
</ul>
<p>Ivar lookup overhead is mostly negated for Ruby 1.9 as the RObject struct stores the first three ivars for each object.</p>
<p><script src="http://gist.github.com/172890.js"></script></p>
<h2>Implementation</h2>
<h3>The callback structure</h3>
<p>We introduce a new callback struct with 2 members :</p>
<ul>
<li><strong>object</strong> Ruby object to invoke the callback on</li>
<li><strong>method</strong> Method to call.Defaults to #call if no method argument given </li>
</ul>
<p>Wrapping the C struct as T_DATA has the least overheads in accessing either the object and the method when our callback fires.</p>
<p><script src="http://gist.github.com/172895.js"></script></p>
<p>GC integration&#8217;s a piece of cake as well.</p>
<p><script src="http://gist.github.com/172899.js"></script></p>
<h3>Allocation</h3>
<p>Wrapping C structures requires an allocator function (Callback.allocate) to initialize our callback struct and register our mark and free functions with the GC.This is usually invoked prior to #initialize and is transparent for our use cases.</p>
<p><script src="http://gist.github.com/172900.js"></script></p>
<h3>Definition</h3>
<p>Three definition (setup) styles supported :</p>
<ul>
<li>Object and method arguments</li>
<li>Block argument</li>
<li>Farmed off an existing object</li>
</ul>
<p><script src="http://gist.github.com/172902.js"></script></p>
<p>We handle each of the argument or block definition styles in an initialize method and handle edge cases such as not assigning a callback method that&#8217;s not defined for the object.It&#8217;s also important to ensure that our callback is frozen at this point ( I&#8217;m looking at you <a href="http://m.onkey.org/2009/8/5/ruby-i-don-t-like-3-object-freeze">lifo</a>, this one&#8217;s legit <img src='http://blog.methodmissing.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) for consistency.</p>
<p><script src="http://gist.github.com/172903.js"></script></p>
<p>Our global function, Callback(), which is defined much like the popular Array() and Float() coercion helpers, and the farm out API reuse the alloc and init covered above.</p>
<p><script src="http://gist.github.com/172904.js"></script></p>
<h2>Results</h2>
<p>An intuitive callback API that&#8217;s slower than method dispatch, but faster than lambda callbacks.</p>
<p><script src="http://gist.github.com/172906.js"></script></p>
<p>Have a look at the <a href="http://github.com/methodmissing/callback/tree/master">source</a> or install the gem to play around.</p>
<p><code>sudo gem install methodmissing-callback</code></p>
<p>Tested on MRI versions > 1.8.6 and 1.9.2 &#8211; please have a look through the test suite for further examples.</p>
<p>Follow me @ <a href="http://github.com/methodmissing">github</a> or <a href="http://twitter.com/methodmissing">twitter</a> if you enjoyed this article.Thanks for reading and special thanks to <a href="http://github.com/tmm1">Aman Gupta</a> for review !</p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/MPMyV0bExZw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/08/22/native-mri-callback/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/08/22/native-mri-callback/</feedburner:origLink></item>
		<item>
		<title>Ruby Memory Allocation</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/-NjKZA41_3Q/</link>
		<comments>http://blog.methodmissing.com/2009/08/08/ruby-memory-allocation/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 00:00:42 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[MRI Internals]]></category>
		<category><![CDATA[dtrace]]></category>
		<category><![CDATA[mri ruby c malloc free realloc calloc gc]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=39</guid>
		<description><![CDATA[During a recent discussion at work, my ever so sharp coworker James Tucker noted the significant void between user code and low level optimizations.   
Micro benchmarks and rubyspec compliance are frequently referenced to compare implementations and quite often cited in random rants as well.What happens at that intermediate, libc, level ? 
In this [...]]]></description>
			<content:encoded><![CDATA[<p>During a recent discussion at <a href="http://www.trade2win.com">work</a>, my ever so sharp coworker <a href="http://blog.ra66i.org/">James Tucker</a> noted the significant void between user code and <a href="http://timetobleed.com/fixing-threads-in-ruby-18-a-2-10x-performance-boost/">low level</a> optimizations.   </p>
<p>Micro benchmarks and <a href="http://github.com/rubyspec/rubyspec/tree/master">rubyspec</a> compliance are frequently referenced to compare implementations and quite often cited in random rants as well.What happens at that intermediate, libc, level ? </p>
<p>In this post we&#8217;ll explore the ISO C memory allocation / deallocation functions as invoked by the following interpreters : </p>
<p>* ruby-1.8.7-p72 (./configure)<br />
* ruby-1.9.1-p129 (./configure)<br />
* jruby-1.3.1 (binary distribution)</p>
<h2>Requirements</h2>
<p>* A <a href="http://en.wikipedia.org/wiki/DTrace">DTrace</a> enabled OS (OS X Leopard, Solaris etc.)<br />
* One or more interpreters installed<br />
* A local checkout of <a href="http://github.com/datamapper/extlib/tree/next">extlib</a></p>
<p>I&#8217;ve opted to NOT test with the latest 1.9.2 preview &#8211; see <a href="http://betterlogic.com/roger/?p=1797">why</a></p>
<h2>The DTrace PID provider</h2>
<p>A set of C level probes is spawned for the lifetime of a given command or existing process.When the process dies, the probe&#8217;s is unset.You don&#8217;t have to recompile or relink &#8211; it just works.See the <a href="http://wikis.sun.com/display/DTrace/pid+Provider">Sun wiki</a> for further information.</p>
<p>This is very different from static probes that ships with <a href="http://dev.mysql.com/doc/refman/6.0/en/dba-dtrace-mysqld-ref.html">MySQL 6</a> or a previously released patched tree by <a href="http://www.joyent.com/joyeurblog/2007/05/07/dtrace-for-ruby-is-available/">Joyent</a>.</p>
<h2>Memory Allocation</h2>
<p>Regardless of the underlying GC implementation, there&#8217;s three ISO C functions that handle memory allocation.</p>
<p>* <strong><a href="http://www.opengroup.org/onlinepubs/000095399/functions/malloc.html">malloc</a></strong> allocates X bytes of memory<br />
* <strong><a href="http://www.opengroup.org/onlinepubs/000095399/functions/calloc.html">calloc</a></strong> allocates memory for X objects of Y size each<br />
* <strong><a href="http://www.opengroup.org/onlinepubs/000095399/functions/realloc.html">realloc</a></strong> shrinks or expands the size of a previously allocated memory region </p>
<p>Each allocation function returns a pointer to the allocated (or reallocated) memory region which can be released with the <a href="http://www.opengroup.org/onlinepubs/000095399/functions/free.html">free</a> function call.</p>
<p>Of note is that most implementations never release memory from the heap back to the underlying OS &#8211; it&#8217;s assigned to a pool for reallocation to reduce system call (sbrk) overhead of the current process.</p>
<h2>Toolbox</h2>
<p><script src="http://gist.github.com/164550.js"></script></p>
<h2>Ruby 1.8.7</h2>
<p>I happen to use this as my stock 1.8 series interpreter &#8211; 1.8.6 should yield similar output.</p>
<p><script src="http://gist.github.com/164551.js"></script></p>
<h2>Ruby 1.9.1</h2>
<p><script src="http://gist.github.com/164553.js"></script></p>
<h2>JRuby 1.3.1</h2>
<p>Again, I&#8217;ve noticed a 1.4 version flying around, but happened to have 1.3.1 installed.</p>
<p><script src="http://gist.github.com/164554.js"></script></p>
<h2>Passing Thoughts</h2>
<p>Note the liberal memory allocation overheads on the 1.8 series, but an otherwise overall similar distribution pattern to 1.9.I can&#8217;t comment much on the JVM case due to limited Java experience.Anyone care to chime in ? </p>
<p>This is an exercise to test the waters for a potential audience for these experiments.I have a few contexts lined up, with a specific MRI focus, but can get into the bowels of most things.Suggestions and thoughts welcome. </p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/-NjKZA41_3Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/08/08/ruby-memory-allocation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/08/08/ruby-memory-allocation/</feedburner:origLink></item>
		<item>
		<title>RailsWayCon</title>
		<link>http://feedproxy.google.com/~r/methodmissing/~3/hZLxgnXrzKA/</link>
		<comments>http://blog.methodmissing.com/2009/05/31/railswaycon/#comments</comments>
		<pubDate>Sun, 31 May 2009 23:19:15 +0000</pubDate>
		<dc:creator>Lourens Naudé</dc:creator>
				<category><![CDATA[Evented Programming]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[MRI Internals]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails railswaycon thread fiber async mri signal eventmachine darkstar aio posix realtime test]]></category>

		<guid isPermaLink="false">http://blog.methodmissing.com/?p=20</guid>
		<description><![CDATA[I recently got out the comfort zone to present at a tech conference, RailsWayCon for the first time.Public speaking being somewhat nerve-wracking for most, especially given most developers are borderline autistic, things went relatively smoothly.
Here follows a quick rundown of each talk as well as embedded slides.Source code and slides have also been made available [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got out the comfort zone to present at a tech conference, <a href="http://www.railswaycon.com">RailsWayCon</a> for the first time.Public speaking being somewhat nerve-wracking for most, especially given most developers are borderline autistic, things went relatively smoothly.</p>
<p>Here follows a quick rundown of each talk as well as embedded slides.Source code and slides have also been made available on my <a href="http://github.com/methodmissing">Github</a> account.</p>
<h2>Embracing Events</h2>
<p>An in depth overview of Event-driven Programming and how the Operating System can help with that.Topics touched upon include :</p>
<ul>
<li>Context Switches ( Threads vs Fibers )</li>
<li>Scheduling ( Cooperative vs Preemptive )</li>
<li>Programming Models ( Evented vs Batched )</li>
<li>Frameworks ( Eventmachine + Neverblock )</li>
<li>Operating System nofication ( Signals + POSIX realtime )</li>
<li>Practices from Online Gaming ( <a href="http://www.projectdarkstar.com">Project Darkstar</a> )</li>
<li>Testing Event-driven Code </li>
</ul>
<p>Perhaps touching on gaming at a Rails conf was inappropriate, but I foresee significant production use of small mountable apps around core Rails infrastructure in the near future.Lightweight processes are no different than tasklets.</p>
<p>I&#8217;m looking to spend some time in the coming weeks on the <a href="http://github.com/methodmissing/rb_darkstar_server/tree/master">JRuby wrap</a> of the Project Darkstar Server module and hope that&#8217;ll at the very least inspire similar projects and advocate production use of JRuby.</p>
<p>Special thanks to <a href="http://oldmoe.blogspot.com">Muhammed Ali</a> for the last minute diagrams.</p>
<div style="width:425px;text-align:left" id="__ss_1508080"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/methodmissing/embracing-events?type=powerpoint" title="Embracing Events">Embracing Events</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=embracingevents-090529153723-phpapp01&#038;stripped_title=embracing-events" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=embracingevents-090529153723-phpapp01&#038;stripped_title=embracing-events" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">Microsoft Word documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/methodmissing">methodmissing</a>.</div>
</div>
<h2>Inside Matz Ruby</h2>
<p>Very much challenged by a lack of time ( 20 minutes !!! ) one had to touch   on a handful of interesting concepts, but it sort of came together as a &#8220;patched&#8221; ( pun intended ) talk jumping from class representations to threading to gc.</p>
<p>As per suggestion from <a href="http://www.yehudakatz.com">wycats</a>, watch out for a series of &#8220;play along at home&#8221; posts that focus on the MRI interpreter.To raise the game, I&#8217;ll try my best to have them VM agnostic ( 1.8 and 1.9 ).</p>
<div style="width:425px;text-align:left" id="__ss_1508081"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/methodmissing/railswaycon-inside-matz-ruby?type=powerpoint" title="Railswaycon Inside Matz Ruby">Railswaycon Inside Matz Ruby</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswayconinsidematzruby-090529153726-phpapp02&#038;stripped_title=railswaycon-inside-matz-ruby" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railswayconinsidematzruby-090529153726-phpapp02&#038;stripped_title=railswaycon-inside-matz-ruby" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">Microsoft Word documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/methodmissing">methodmissing</a>.</div>
</div>
<h2>Thank You&#8217;s</h2>
<p>It&#8217;s been a great week &#8211; no fuzz, no drama.Lotta coffee, little sleep, lotta code.I&#8217;d like to take a moment and reflect on the hospitality of the following individuals / companies, in addition to the <a href="http://www.railswaycon.com">RailsWayCon</a> team.</p>
<h3><a href="http://www.paperplanes.de/">Mathias Meyer</a> and <a href="http://blog.innerewut.de/">Jonathan Weiss</a></h3>
<p>Recommendations for meals, coffee, transport, being loony and making time available from busy schedules, and families.The definite deployment and scaling experts through <a href="http://www.peritor.com/">Peritor</a>, do watch out for a unique EC2 product to be launched soon.</p>
<h3>Alex, Thilo &#038;&#038; Jan at <a href="http://upstream-berlin.com/">Upstream Agile</a></h3>
<p>Great office space for co-working and an ample supply of <a href="http://en.wikipedia.org/wiki/Club-Mate">Club-Mate</a>.Alex and Thilo recently built <a href="http://doingtext.com/">DoingText</a> and <a href="http://jan.prima.de/">Jan</a>&#8217;s working on a stealth Couch DB project. </p>
<h3><a href="http://www.artweb-design.de/">Sven Fuchs</a> &#038;&#038; <a href="http://www.railway.at/">Clemens Kofler</a></h3>
<p>Localization and i18n experts.When not co-working with Clemens and the 90 dB his macbook fan emits, Sven specializes in dancing after 02:30am.</p>
<img src="http://feeds.feedburner.com/~r/methodmissing/~4/hZLxgnXrzKA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.methodmissing.com/2009/05/31/railswaycon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.methodmissing.com/2009/05/31/railswaycon/</feedburner:origLink></item>
	</channel>
</rss>
