<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Struggling with pyrex</title>
	<atom:link href="http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/</link>
	<description>games, tech, web, stuff, biz, and bilge</description>
	<pubDate>Wed, 03 Dec 2008 07:26:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-233</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Tue, 04 Dec 2007 18:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-233</guid>
		<description>Okay - that change got the speed similar to PyPy/Rpython and Shed-skin.</description>
		<content:encoded><![CDATA[<p>Okay - that change got the speed similar to PyPy/Rpython and Shed-skin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allefant</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-232</link>
		<dc:creator>Allefant</dc:creator>
		<pubDate>Tue, 04 Dec 2007 18:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-232</guid>
		<description>It should have been:
            a=(&#60;float&#62;x/SW) * 4.0 - 2.0
            b=(&#60;float&#62;y/SH) * 4.0 - 2.0</description>
		<content:encoded><![CDATA[<p>It should have been:<br />
            a=(&lt;float&gt;x/SW) * 4.0 - 2.0<br />
            b=(&lt;float&gt;y/SH) * 4.0 - 2.0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allefant</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-231</link>
		<dc:creator>Allefant</dc:creator>
		<pubDate>Tue, 04 Dec 2007 18:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-231</guid>
		<description>Hm, somehow &#60; and &#62; got eaten in my comment?</description>
		<content:encoded><![CDATA[<p>Hm, somehow &lt; and &gt; got eaten in my comment?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allefant</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-230</link>
		<dc:creator>Allefant</dc:creator>
		<pubDate>Tue, 04 Dec 2007 17:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-230</guid>
		<description>Sorry, I didn' have a runnable version yet when I looked at the code yesterday, so didn't try to pinpoint the speed problem. The mistake is one pyrex peculiarity - to get C style casts you need to use  not float(). Now what happens in your code is, you perform lots of calls to the Python function float() where you meant to do a cast - killing any performance.

Replace this:
            a=(float(x/SW) * 4.0 - 2.0)
            b=(float(y/SH) * 4.0 - 2.0)
with this:
            a=(x/SW) * 4.0 - 2.0
            b=(y/SH) * 4.0 - 2.0

And the per-frame time should drop by a factor of 10 or 20 :)</description>
		<content:encoded><![CDATA[<p>Sorry, I didn&#8217; have a runnable version yet when I looked at the code yesterday, so didn&#8217;t try to pinpoint the speed problem. The mistake is one pyrex peculiarity - to get C style casts you need to use  not float(). Now what happens in your code is, you perform lots of calls to the Python function float() where you meant to do a cast - killing any performance.</p>
<p>Replace this:<br />
            a=(float(x/SW) * 4.0 - 2.0)<br />
            b=(float(y/SH) * 4.0 - 2.0)<br />
with this:<br />
            a=(x/SW) * 4.0 - 2.0<br />
            b=(y/SH) * 4.0 - 2.0</p>
<p>And the per-frame time should drop by a factor of 10 or 20 <img src='http://www.philhassey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Dufour</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-229</link>
		<dc:creator>Mark Dufour</dc:creator>
		<pubDate>Tue, 04 Dec 2007 17:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-229</guid>
		<description>doesn't that kind of defeat the purpose of pyrex?

btw, JIT compilers are similarly intransparent. with Psyco, it's hard to tell when and why something will go much faster or not.</description>
		<content:encoded><![CDATA[<p>doesn&#8217;t that kind of defeat the purpose of pyrex?</p>
<p>btw, JIT compilers are similarly intransparent. with Psyco, it&#8217;s hard to tell when and why something will go much faster or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oleastre</title>
		<link>http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-227</link>
		<dc:creator>oleastre</dc:creator>
		<pubDate>Tue, 04 Dec 2007 08:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2007/12/03/struggling-with-pyrex/#comment-227</guid>
		<description>For m, pyrex is usefulle to interface C code with python one, not for directly implementing stuff.

You may write time consuming parts of your code in C and interface it with pyrex to be callable from python.</description>
		<content:encoded><![CDATA[<p>For m, pyrex is usefulle to interface C code with python one, not for directly implementing stuff.</p>
<p>You may write time consuming parts of your code in C and interface it with pyrex to be callable from python.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
