<?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>fforw.de &#187; stats</title>
	<atom:link href="http://fforw.de/tag/stats/feed/" rel="self" type="application/rss+xml" />
	<link>http://fforw.de</link>
	<description>skip the boring parts</description>
	<lastBuildDate>Thu, 29 Jul 2010 10:19:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Closure Tools</title>
		<link>http://fforw.de/post/google-closure-tools/</link>
		<comments>http://fforw.de/post/google-closure-tools/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 11:58:27 +0000</pubDate>
		<dc:creator>fforw</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[closure compiler]]></category>
		<category><![CDATA[closure library]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[yuicompressor]]></category>

		<guid isPermaLink="false">http://fforw.de/?p=122</guid>
		<description><![CDATA[Some days ago, Google released the Google Closure Tools, that look very promising. I&#8217;ve yet been unable to feel particular enthusiasm for the Google Closure Library which seems like just another JavaScript (-only)? libary, something that may only be of any importance because it&#8217;s coming from Google, but who does not seem to provide anything [...]]]></description>
			<content:encoded><![CDATA[<div class='en' style='' lang='en' dir=''>
<p>Some days ago, Google released the <a href="http://code.google.com/closure/">Google Closure Tools</a>, that look very promising. I&#8217;ve yet been unable to feel particular enthusiasm for the <a href="http://code.google.com/closure/library/">Google Closure Library</a> which seems like just another JavaScript (-only)? libary, something that may only be of any importance because it&#8217;s coming from Google, but who does not seem to provide anything really spectacular or new.</p>
<p>The <a href="http://code.google.com/closure/compiler/">Closure Compiler</a>, however looks really good. It&#8217;s not only a simple script compressor, but also offering dead code removal and lint-like feature. I&#8217;ve been doing some testing with our main JavaScript bundle(all JavaScript code used in our test application concatenated together):</p>
<table border="0">
<tbody>
<tr>
<th>Description</th>
<th>Bytes abs</th>
<th>Bytes %</th>
</tr>
<tr>
<td>js bundle</td>
<td>284935</td>
<td>100,0%</td>
</tr>
<tr>
<td>yuicompressor compressed</td>
<td>126656</td>
<td>44.5%</td>
</tr>
<tr>
<td>closure compiler compressed</td>
<td>97362</td>
<td>34.2%</td>
</tr>
<tr>
<td>js bundle gzip</td>
<td>75163</td>
<td>26.4%</td>
</tr>
<tr>
<td>yui + gzip</td>
<td>42189</td>
<td>14.8%</td>
</tr>
<tr>
<td>closure + gzip</td>
<td>35432</td>
<td>12.4%</td>
</tr>
</tbody>
</table>
<p>As you can see, Closure compiler is a bit better  than yuicompressor. The only downside to it is that it doesn&#8217;t support IE conditional comments. This means that above numbers a little too good for Google Closure as we are using some IE conditional comments for compatibility purposes.</p>
<p>The depedency management looks promising, too. So far I am using a self-brew solution for my current project at work, but I would really like to see a standard for packaging, compression and deployment for Javascript.</p>
</div>
<p>
<p><small>This Article is also available in <b>Deutsch</b>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://fforw.de/post/google-closure-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory consumption changes in svenson 1.3</title>
		<link>http://fforw.de/post/memory-consumption-changes-in-svenson-13/</link>
		<comments>http://fforw.de/post/memory-consumption-changes-in-svenson-13/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 15:00:24 +0000</pubDate>
		<dc:creator>fforw</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[jcouchdb]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[svenson]]></category>

		<guid isPermaLink="false">http://blog.willie/?p=4</guid>
		<description><![CDATA[Implementing a streaming attachment feature for jcouchdb, I started to wonder whether it would be a good idea for svenson to support JSON parsing from a stream, too, as I don&#8217;t really need the complete stream to start constructing the java object graph. Implementing stream parsing was really nice and easy thanks to the units [...]]]></description>
			<content:encoded><![CDATA[<p>Implementing a streaming attachment feature for <a title="jcouchdb project page at google code" href="http://code.google.com/p/jcouchdb/">jcouchdb</a>, I started to wonder whether it would be a good idea for svenson to support JSON parsing from a stream, too, as I don&#8217;t really need the complete stream to start constructing the java object graph.</p>
<p>Implementing stream parsing was really nice and easy thanks to the units test present in svenson. After that, I came upon two ways to generally cut down on memory use. All tokens with fixed values could just have a single instance. The recording of tokens to provide token based look ahead was not really needed in all cases. But how much does that save?</p>
<p>As a test case I wrote a small tool class to generate random, nested JSON datasets, generated two test files of 65kb and 4.5mb size and parsed these with svenson 1.2.8 and what now is svenson 1.3.</p>
<p>Measuring the actual memory usage for these two test files proved to be difficult. Somehow none of the programs I tried seemed to give me the data I wanted. Eclipse TPTP just ignored Strings that were no member of any class but just parameters, making stream and string parsing look exactly the same memory-wise. tijmp and others did not provide the data I wanted at all.</p>
<p>So in the end I wrote a little python script that parses a hprof ASCII output to</p>
<ul>
<li>sum up all memory use</li>
<li>group allocations by class type, but only if the stack trace of it touches svenson</li>
<li>output the top 10 of those classes and the sums</li>
</ul>
<p>This provided meaningful data and also showed some points for further improvement. There was a huge number of java.lang.reflect.Method allocations which turned out to be caused by svenson inspecting the target classes for annotations and appropriate methods which was done on a per target basis instead of the better per target class basis.</p>
<p>All in all the memory usage went down quite a bit:</p>
<div class="wp-caption aligncenter" style="width: 507px"><img title="memory usage diagram" src="http://fforw.de/static/image/svenson-combined.png" alt="memory usage for different svenson versions, with and without streaming" width="497" height="296" /><p class="wp-caption-text">memory usage for different svenson versions, with and without streaming</p></div>
<p>45% less memory for the small file and 62% for the large file for all allocations. I think that is really good..</p>
<p>Below are some links to the files needed to repeat the benchmarking. The transform hprof script might also prove to be useful for other projects if changed appropriately.</p>
<p>The new jcouchdb release will also use stream parsing.</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="/static/files/svenson-memory-report.txt">Detailed data: Top 10 memory use by class and sums for all 6 variants</a></li>
<li><a href="/static/files/transform_hprof.py">Python script to transform hprof ASCII output</a></li>
<li><a href="http://svenson.googlecode.com/svn/trunk/test/org/svenson/RandomJSON.java">Random JSON Generator</a></li>
<li><a href="/static/files/small.json">Small JSON test file</a></li>
<li><a href="/static/files/big.json">Big JSON test file</a></li>
</ul>
<p><strong>edit:</strong><br />
The command to generate the hprof file was something like</p>
<blockquote><p>java -agentlib:hprof=heap=sites,depth=100,cutoff=0 -cp .. svensonperf.ReadJSONOld big.json</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://fforw.de/post/memory-consumption-changes-in-svenson-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
