<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Bit Mojo - Hiram Chirino &#187; apache</title>
	<atom:link href="http://hiramchirino.com/blog/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://hiramchirino.com/blog</link>
	<description>My Ramblings on Hawt Tech</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:25:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>STOMP Clarification</title>
		<link>http://hiramchirino.com/blog/2009/09/stomp-clarification/</link>
		<comments>http://hiramchirino.com/blog/2009/09/stomp-clarification/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 13:22:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[stomp]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/09/stomp-clarification/</guid>
		<description><![CDATA[I just saw a tweet which demonstrates that the STOMP spec still needs more clarification. I think Brian McCallister, the founding architect of protocol, will agree that one of the tenets of the protocol was for it to be simple enough to even use by user which directly connects to a server via telnet. And [...]]]></description>
			<content:encoded><![CDATA[<p>I just saw a <a href="https://twitter.com/benjaminws/statuses/4112169015" onclick="pageTracker._trackPageview('/outgoing/twitter.com/benjaminws/statuses/4112169015?referer=');">tweet</a> which demonstrates that the <a href="http://activemq.apache.org/stomp/stomp10/specification.html" onclick="pageTracker._trackPageview('/outgoing/activemq.apache.org/stomp/stomp10/specification.html?referer=');">STOMP spec</a> still needs more clarification.  I think <a href="http://skife.org/" onclick="pageTracker._trackPageview('/outgoing/skife.org/?referer=');">Brian McCallister</a>, the founding architect of protocol, will agree that one of the tenets of the protocol was for it to be simple enough to even use by user which directly connects to a server via telnet.</p>
<p>And to support that use case, newlines after the frame terminator are a natural occurrence.  But it might be easier to describe it as:
<ul>
<li>A stomp frame may have zero or more newlines preceding it&#8217;s command verb.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/09/stomp-clarification/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ActiveMQ Protobuf Implemtation Features</title>
		<link>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/</link>
		<comments>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:57:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[protobuf]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/09/activemq-protobuf-implemtation-features/</guid>
		<description><![CDATA[I promised I would follow up on my previous post on how the &#8220;The ActiveMQ Protobuf Implementation Rocks!&#8221;. So you might be asking yourself, what&#8217;s the secret sauce? Well before I get into that, let me first explain the class model that our proto compiler generates. For every message definition in the &#8216;.proto&#8217; file, the [...]]]></description>
			<content:encoded><![CDATA[<p>I promised I would follow up on my previous post on how the <a href="http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks">&#8220;The ActiveMQ Protobuf Implementation Rocks!&#8221;.</a></p>
<p>So you might be asking yourself, what&#8217;s the secret sauce? Well before I get into that, let me first explain the class model that our proto compiler generates.</p>
<p>For every message definition in the &#8216;.proto&#8217; file, the compiler will generate 3 classes:
<ul>
<li>the message interface: is implemented by the bean and buffer classes.  It has all the &#8216;getters&#8217;.</li>
<li>the bean class: has all the &#8216;setters&#8217; and &#8216;merge&#8217; methods</li>
<li>the buffer class: has all the encoding and decoding methods.  It does not allow mutation.</li>
</ul>
<p>The message interface also defines the freeze(), frozen(), and copy() methods which allow you to make an instance immutable, check to see if an instance is immutable, and create a mutable copy.  Buffer classes are alway immutable.  Bean class can transition to being immutable via freeze().  freeze() naturally returns a buffer object.  copy() naturally returns a bean object.</p>
<p>This bean model gives substantial flexibility.  Besides making it easy to transition from immutable to mutable and back, the message interface lets you implement business methods that operate against either type of instance.  You could use the bean class purely in a builder style to always generate a buffer instance, or you could just use them like traditional java bean objects.</p>
<p>Once a bean instance is frozen, any attempts to modify the instance will throw assertion errors if assertions are enabled in your JVM.  So the CPU cost of validating program correctness can can be disabled at run time.</p>
<p>Finally, the most important feature of the buffer class is that it holds on to either the byte array that it was created from or the frozen bean that created it, and sometimes both, after it builds one from the other.  This has several implications.  Firstly, once a buffer is encoded to a byte[], subsequent encoding passes are free.  This is also true when a buffer is decoded, as the next encoding is free since it still retains the original encoding of the message.  And the other benefit that this provides which the benchmark highlighted, is that deferred decoding is possible.  A newly created buffer class will not decode the data until a field is accessed.  This also true of the nested messages that are encoded in a buffer.  While the outer message may get decoded, the nested message will not be decoded until it&#8217;s fields are accessed.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The ActiveMQ Protobuf Implementation Rocks!</title>
		<link>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/</link>
		<comments>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:15:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[protobuf]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/09/the-activemq-protobuf-implementation-rocks/</guid>
		<description><![CDATA[While reading Comparing the Java Serialization Options I ran across the a cool google code project which has done an excellent job benchmarking a wide variety of serialization options for java. I&#8217;ve had been researching the protobuf encoding format for a while and really liked it. But I did not really like the Java implementation [...]]]></description>
			<content:encoded><![CDATA[<p>While reading <a href="http://www.theserverside.com/news/thread.tss?thread_id=57871" onclick="pageTracker._trackPageview('/outgoing/www.theserverside.com/news/thread.tss?thread_id=57871&amp;referer=');">Comparing the Java Serialization Options</a> I ran across the a <a href="http://code.google.com/p/thrift-protobuf-compare/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/?referer=');">cool google code project</a> which has done an excellent job <a href="http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking?ts=1237772203&amp;updated=Benchmarking" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking?ts=1237772203_amp_updated=Benchmarking&amp;referer=');">benchmarking</a> a wide variety of serialization options for java.</p>
<p>I&#8217;ve had been researching the <span class="blsp-spelling-error" id="SPELLING_ERROR_0">protobuf</span> encoding format for a while and really liked it.  But I did not really like the Java implementation that Google had published.  It was kinda clunky to use and I saw several optimizations that could be used that were missing.  Optimizations that could create huge performance wins when applied to the usage patterns of an enterprise messaging system like <a href="http://activemq.apache.org/" onclick="pageTracker._trackPageview('/outgoing/activemq.apache.org/?referer=');">Apache <span class="blsp-spelling-error" id="SPELLING_ERROR_1">ActiveMQ</span></a>.  So I created<a href="http://svn.apache.org/repos/asf/activemq/sandbox/activemq-flow/activemq-protobuf/" onclick="pageTracker._trackPageview('/outgoing/svn.apache.org/repos/asf/activemq/sandbox/activemq-flow/activemq-protobuf/?referer=');"> a new <span class="blsp-spelling-error" id="SPELLING_ERROR_2">protobuf</span> implementation</a> in the <span class="blsp-spelling-error" id="SPELLING_ERROR_3">ActiveMQ</span> project.</p>
<p>Naturally, I was curious to see how the <span class="blsp-spelling-error" id="SPELLING_ERROR_4">activemq</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_5">protobuf</span> implementation stacked up against similar technologies.  So I grabbed the V1 benchmark source code and added our implementation to it.  If you want to do the same, apply <a href="http://code.google.com/p/thrift-protobuf-compare/issues/detail?id=8" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/issues/detail?id=8&amp;referer=');">this patch</a>.</p>
<p>Once I ran the benchmark and I was very pleased with the results.  I&#8217;m including the performance graphs of our <span class="blsp-spelling-error" id="SPELLING_ERROR_6">impl</span> and standard <span class="blsp-spelling-error" id="SPELLING_ERROR_7">protobuf</span> and thrift for comparison.</p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeCreate&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:246.79,208.72,304.14&amp;chds=0,506&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeSer&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:3087.0,3121.5,3205.0&amp;chds=0,6274&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeDSer&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:53.5,3231.0,1936.5&amp;chds=0,3480&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=totalTime&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:3387.29,6561.219999999999,5445.639999999999&amp;chds=0,10262&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p>As it turns out, our implementation looks <span class="blsp-spelling-corrected" id="SPELLING_ERROR_8">awesome</span> in the benchmark! How about that decoding<span class="blsp-spelling-error" id="SPELLING_ERROR_9"></span> speed!</p>
<p>It&#8217;s getting late here.. so I&#8217;ll have do a follow up post explaining how come we did so much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

