<?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>Faux&#039;s Blog &#187; Uncategorized</title>
	<atom:link href="http://blog.prelode.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.prelode.com</link>
	<description>On Prelode&#039;s development.. once it begins, anyway..</description>
	<lastBuildDate>Wed, 04 Aug 2010 22:13:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java&#8217;s ZipFile performance</title>
		<link>http://blog.prelode.com/2010/08/java-zipfile-performance/</link>
		<comments>http://blog.prelode.com/2010/08/java-zipfile-performance/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 21:40:48 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=127</guid>
		<description><![CDATA[I have an application that scales well up to around five threads a core, due to the mix of IO and CPU that it does.
That is, you give it more threads, and the throughput increases; the overall time goes down.
The following graph shows, in blue, the Sun&#8217;s java.util.zip.ZipFile time to complete a set of unzips [...]]]></description>
			<content:encoded><![CDATA[<p>I have an application that scales well up to around five threads a core, due to the mix of IO and CPU that it does.</p>
<p>That is, you give it more threads, and the throughput increases; the overall time goes down.</p>
<p>The following graph shows, in blue, the Sun&#8217;s java.util.zip.ZipFile time to complete a set of unzips on an increasing number of threads:</p>
<p><img src="http://b.goeswhere.com/zf-perf.png"/></p>
<p>Wait, what the cocking shit.</p>
<p><span id="more-127"></span></p>
<hr />
<p>The red line shows a pure Java implementation of ZipFile that scales expectedly well.  It&#8217;s slower on one thread, unfortunately, but faster than the synchronised Sun ZipFile with two threads.</p>
<p>As expected, the performance of Sun&#8217;s implementation massively increases (for large number of threads) if you manually synchronise on a global monitor around the ZipFile uses.  Red line unchanged:</p>
<p><img src="http://b.goeswhere.com/zf-sync-perf.png"/></p>
<hr />
<p>Y-axis: Seconds.<br />
X-axis: 2^(n-1) threads (i.e. levelling out at 3 due to it being tested on a quad-core machine and being entirely CPU bound).</p>
<p>Test: Opening rt.jar and summing all the bytes in files who&#8217;s path contains an &#8216;e&#8217;.<br />
File entirely cached by the file-system.  JIT warmed.  Heap significantly larger than required.</p>
<p>Vista x64, Sun Java 1.6u20 x64 (i.e. server vm).</p>
<p>java -cp <a href="http://jazzlib.sf.net/">jazzlib-binary-0.07.zip</a>:. <a href="http://b.goeswhere.com/ZipFileTester.java">ZipFileTester</a> somefile.zip</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/08/java-zipfile-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
