<?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>Brainfold &#187; benchmark</title>
	<atom:link href="http://www.brainfold.org/blog/tag/benchmark/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainfold.org/blog</link>
	<description>On Python, game development and everything</description>
	<lastBuildDate>Sat, 15 May 2010 21:58:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>More types and results</title>
		<link>http://www.brainfold.org/blog/2010/03/18/more-types-and-results/</link>
		<comments>http://www.brainfold.org/blog/2010/03/18/more-types-and-results/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 22:38:43 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[benchmark]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[pyeigen]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=221</guid>
		<description><![CDATA[I implemented some new types for PyEigen, including a 4x4 matrix class and benchmarks for it. Same methods as last time, but quite different results. PyEigen is still fastest by far, which is promising. This time it was about 5-10x faster than cgkit1, which was again the second fastest. You might also notice that vectypes [...]]]></description>
			<content:encoded><![CDATA[<p>I implemented some new types for PyEigen, including a 4x4 matrix class and benchmarks for it. Same methods as last time, but quite different results.</p>
<div id="attachment_222" class="wp-caption alignnone" style="width: 531px"><a href="http://www.brainfold.org/blog/wp-content/uploads/2010/03/benchmark1.png"><img class="size-full wp-image-222 " title="Linear algebra library 4x4 matrix benchmark" src="http://www.brainfold.org/blog/wp-content/uploads/2010/03/benchmark1.png" alt="Benchmark results" width="521" height="464" /></a><p class="wp-caption-text">Benchmark results</p></div>
<p>PyEigen is still fastest by far, which is promising. This time it was about 5-10x faster than cgkit1, which was again the second fastest. You might also notice that vectypes is missing. For this test, it was so slow that I had to leave it out; other results would have been invisible if I had fitted the vectypes results in the graph. In the worst case, it was over <strong>1000x</strong> slower than PyEigen! Euclid is missing addition and scalar multiplication scores since it doesn't support those operations. NumPy performed much better. There has to be a faster way to do vector cross product in NumPy, since matrix multiplication was much faster than cross product. But it's not a big deal anymore since PyEiglet is so much faster than anything else. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2010/03/18/more-types-and-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Surprising results</title>
		<link>http://www.brainfold.org/blog/2010/03/17/surprising-results/</link>
		<comments>http://www.brainfold.org/blog/2010/03/17/surprising-results/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 23:13:50 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[benchmark]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[pyeigen]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=213</guid>
		<description><![CDATA[I did some preliminary benchmarking today and got very interesting results. I have only wrapped a 3D vector class so far, so I tested a couple of operations (add, multiply, dot &#38; cross product) against the libs I mentioned in the previous post: NumPy, euclid, vectypes and cgkit. For cgkit, I tested both 1.2.0 and [...]]]></description>
			<content:encoded><![CDATA[<p>I did some preliminary benchmarking today and got very interesting results. I have only wrapped a 3D vector class so far, so I tested a couple of operations (add, multiply, dot &amp; cross product) against the libs I mentioned in the previous post: <a href="http://numpy.scipy.org/">NumPy</a>, <a href="http://www.partiallydisassembled.net/euclid.html">euclid</a>, <a href="http://code.google.com/p/vectypes/">vectypes</a> and <a href="http://cgkit.sourceforge.net/">cgkit</a>. For cgkit, I tested both 1.2.0 and 2.0 alpha 9. All other libs were the latest version. I tested using the Python timeit module with 1,000,000 calls and 3 repeats per test and took the lowest number. Repeated test results generally differed only by milliseconds.</p>
<div id="attachment_214" class="wp-caption alignnone" style="width: 601px"><a href="http://www.brainfold.org/blog/wp-content/uploads/2010/03/benchmark.png"><img class="size-full wp-image-214 " title="Linear algebra library benchmark" src="http://www.brainfold.org/blog/wp-content/uploads/2010/03/benchmark.png" alt="Benchmark results" width="591" height="472" /></a><p class="wp-caption-text">Benchmark results</p></div>
<p>The immediately obvious surprise is the abysmal performance of NumPy especially in cross products. I don't think NumPy optimizes for fixed-size arrays; I would have been better off with the pure-Python euclid and vectypes modules.</p>
<p>The other surprises were euclid vs vectypes and cgkit1 vs cgkit2. Euclid and vectypes are both by Alex Holkner of <a href="http://pyglet.org/">Pyglet</a> fame. In both cases, the newer library (vectypes and cgkit2) was also slower.</p>
<p>Of course the most positive surprise for me was the performance of PyEigen. It's only a trivial wrapping, but was about 2-8x faster than the best alternative, cgkit1. I'm very happy with the results and definitely going to continue development of the library / wrapper. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update:</strong> <a href="http://bazaar.launchpad.net/~knarkles/pyeigen/trunk/annotate/head%3A/test/benchmark/vector3.py">Here's</a> the benchmark code. Also an interesting detail: PyEigen is <strong>136x</strong> faster than NumPy with cross products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2010/03/17/surprising-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
