<?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"
	>

<channel>
	<title>GTSystem Tech Blog</title>
	<atom:link href="http://www.gtsystem.eu/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gtsystem.eu/blog</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 25 Aug 2009 07:38:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Improved performance of Python 3.1</title>
		<link>http://www.gtsystem.eu/blog/2009/08/improved-performance-of-python-31/</link>
		<comments>http://www.gtsystem.eu/blog/2009/08/improved-performance-of-python-31/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 14:41:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.gtsystem.eu/blog/?p=39</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2009/08/improved-performance-of-python-31/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'Improved performance of Python 3.1';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
In my previous post (six months ago) I claim about the bad performance of Python 3.0. The first py3k version contained a new I/O library written totally in python that was the main cause of such problems.
Now Python 3.1 present a totally new I/O Library rewritten in c for maximum performance. As promised, I re-execute all [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2009/08/improved-performance-of-python-31/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'Improved performance of Python 3.1';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>In my <a href="2008/12/python-30-io-performance-issues/" target="_blank">previous post</a> (six months ago) I claim about the bad performance of Python 3.0. The first py3k version contained a new I/O library written totally in python that was the main cause of <a href="http://bugs.python.org/issue4561" target="_blank">such problems</a>.</p>
<p>Now Python 3.1 present a totally new I/O Library rewritten in c for maximum performance. As promised, I re-execute all my previus tests with the latest python version (3.1.1).</p>
<p>The next graph show the results, look at my <a href="2008/12/python-30-io-performance-issues/" target="_blank">previous post</a> for details on the tests.</p>
<p><div id="attachment_40" class="wp-caption alignnone" style="width: 510px"><a href="http://www.gtsystem.eu/blog/wp-content/uploads/2009/08/pytestgraph.jpg"><img class="size-full wp-image-40" title="pytestgraph" src="http://www.gtsystem.eu/blog/wp-content/uploads/2009/08/pytestgraph.jpg" alt="Different python version compared for performance" width="500" height="310" /></a><p class="wp-caption-text">Different python version compared for performance</p></div></p>
<p><strong>Text Read/Write</strong></p>
<p>First you can see that the incredible bad text read issue is now solved. Python 3.1 is now much much faster, but it remain 2.42x slower than python 2.5. This is probably due to the text decoding phase. Text writing is now comparable to python 2.5.</p>
<p><strong>Binary Read/Write</strong></p>
<p>The rewritten I/O module is now able to read binary data faster than before. The same is not true for the writing performance that remain slow as Python 3.0.</p>
<p><strong>Print</strong></p>
<p>Another problem that I noticed in python 3.0 was the very bad performance on the new print function compared to the old print statement. In this test, Python 3.1 is now &#8220;only&#8221; 5 times slower than Python 2.5.</p>
<p>In general a good work was done to optimize py3k. I think that for general applications, py3k is now perfectly usable.</p>
<p>Many thanks to the python development team!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gtsystem.eu/blog/2009/08/improved-performance-of-python-31/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python 3.0 I/O performance issues</title>
		<link>http://www.gtsystem.eu/blog/2008/12/python-30-io-performance-issues/</link>
		<comments>http://www.gtsystem.eu/blog/2008/12/python-30-io-performance-issues/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 07:55:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.gtsystem.eu/blog/?p=15</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2008/12/python-30-io-performance-issues/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'Python 3.0 I/O performance issues';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
Python 3.0 (aka Python 3000) was released about a week ago.
In the what&#8217;s new the python team claim:
The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. There’s room for improvement, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2008/12/python-30-io-performance-issues/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'Python 3.0 I/O performance issues';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>Python 3.0 (aka Python 3000) was released about a week ago.</p>
<p>In the <a href="http://docs.python.org/3.0/whatsnew/3.0.html">what&#8217;s new</a> the python team claim:</p>
<blockquote><p>The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. There’s room for improvement, but it will happen after 3.0 is released!</p></blockquote>
<p>In this week however, many people notice big performance differences in the new version versus the old 2.5/2.6 series related to I/O.</p>
<p>Since the read and write performance are very important for my work (data analysis), I did some tests in my laptop (MacBook Pro 2.4Ghz).</p>
<p>I installed from source code Python 2.5.2 and Python 3.0. Similar script has been compared by running them 5 times and taking average times.</p>
<h3>Binary Read Test</h3>
<p>Loading of a big file (156Mb) into memory in one step.</p>
<table border="0">
<tbody>
<tr>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!python2.5</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;bigfile.txt&quot;</span>,<span style="color: #483d8b;">&quot;rb&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span></pre></div></div>

</td>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!python3.0</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;bigfile.txt&quot;</span>,<span style="color: #483d8b;">&quot;rb&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

</td>
</tr>
<tr>
<td>Avg: 0.459 sec</td>
<td>Avg: 0.761 sec (<strong>+66%</strong>)</td>
</tr>
</tbody>
</table>
<p><span id="more-15"></span></p>
<h3>Text Read Test</h3>
<p>Iterating over a big file (156Mb) line by line.</p>
<table border="0">
<tbody>
<tr>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;bigfile.txt&quot;</span>,<span style="color: #483d8b;">&quot;r&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> l <span style="color: #ff7700;font-weight:bold;">in</span> f:
	<span style="color: #ff7700;font-weight:bold;">pass</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span></pre></div></div>

</td>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;bigfile.txt&quot;</span>,<span style="color: #483d8b;">&quot;rt&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> l <span style="color: #ff7700;font-weight:bold;">in</span> f:
	<span style="color: #ff7700;font-weight:bold;">pass</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

</td>
</tr>
<tr>
<td>Avg: 0.713 sec</td>
<td>Avg: 35.709 sec (<strong>+4,909%</strong>)</td>
</tr>
</tbody>
</table>
<p> </p>
<h3>Binary Write Test</h3>
<p>This test measure writing time for binary data 100Mb.</p>
<table border="0">
<tbody>
<tr>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
l = <span style="color: #483d8b;">&quot;A&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">1024</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">1024</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;writefile.txt&quot;</span>,<span style="color: #483d8b;">&quot;wb&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>:
	f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span></pre></div></div>

</td>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
l = <span style="color: #483d8b;">&quot;A&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">1024</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">1024</span>
l=l.<span style="color: black;">encode</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;iso-8859-1&quot;</span><span style="color: black;">&#41;</span>
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;writefile.txt&quot;</span>,<span style="color: #483d8b;">&quot;wb&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>:
	f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

</td>
</tr>
<tr>
<td>Avg: 2.501 sec</td>
<td>2.572 sec (<strong>+3%</strong>)</td>
</tr>
</tbody>
</table>
<p> </p>
<h3>Text Write Test</h3>
<p>Write performance for text files.</p>
<table border="0">
<tbody>
<tr>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
l = <span style="color: #483d8b;">&quot;*&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">1024</span> + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;writefile.txt&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100000</span><span style="color: black;">&#41;</span>:
	f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span></pre></div></div>

</td>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
l = <span style="color: #483d8b;">&quot;*&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">1024</span> + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;writefile.txt&quot;</span>,<span style="color: #483d8b;">&quot;wt&quot;</span><span style="color: black;">&#41;</span>
start = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100000</span><span style="color: black;">&#41;</span>:
	f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
stop = <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f sec&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>stop-start<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

</td>
</tr>
<tr>
<td>Avg: 2.564 sec</td>
<td>Avg: 5.315 (<strong>+107%</strong>)</td>
</tr>
</tbody>
</table>
<p> </p>
<h3>Print</h3>
<p>From Python 3.0 &#8220;print&#8221; became a function. Previously it was a statement.  What does it means? From a syntax point of view, are necessary small changes (for example add brackets around parameters). But the real bad news are on the execution time. In this test I compare the execution of the statement/function without parameters.</p>
<table border="0">
<tbody>
<tr>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">timeit</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #dc143c;">cmd</span>=<span style="color: #483d8b;">'for i in xrange(1000000): print '</span>
t=<span style="color: #dc143c;">timeit</span>.<span style="color: black;">Timer</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>.<span style="color: #dc143c;">timeit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f sec<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> t<span style="color: black;">&#41;</span></pre></div></div>

</td>
<td>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">timeit</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #dc143c;">cmd</span>=<span style="color: #483d8b;">'for i in range(1000000): print()'</span>
t=<span style="color: #dc143c;">timeit</span>.<span style="color: black;">Timer</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>.<span style="color: #dc143c;">timeit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%.3f<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> t<span style="color: black;">&#41;</span></pre></div></div>

</td>
</tr>
<tr>
<td>Avg: 0.230 sec</td>
<td>Avg: 10.956 sec (<strong>+4,655%</strong>)</td>
</tr>
</tbody>
</table>
<p> </p>
<p>In the next python release (3.0.1), is expected some speed improvement on many of the previous tests. I will redo my test when this new version will be available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gtsystem.eu/blog/2008/12/python-30-io-performance-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>iPhone SDK 2.2 Localizable.strings bug</title>
		<link>http://www.gtsystem.eu/blog/2008/12/iphone-sdk-22-localizablestrings-bug/</link>
		<comments>http://www.gtsystem.eu/blog/2008/12/iphone-sdk-22-localizablestrings-bug/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 18:12:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Xcode]]></category>

		<category><![CDATA[Localizable]]></category>

		<guid isPermaLink="false">http://www.gtsystem.eu/blog/?p=5</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2008/12/iphone-sdk-22-localizablestrings-bug/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'iPhone SDK 2.2 Localizable.strings bug';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
In the latest release of the iPhone SDK 2.2 (9m2621) there is an issue concerning the localization procedure.
When the input string file is utf-8 and &#8220;Strings file Output Encoding&#8221; is set to binary, the resulting file isn&#8217;t Localizable.string but Localizable.string.XXXX where XXXX is a pid number.
To correct this issue you can patch the ruby script copystrings located [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://www.gtsystem.eu/blog/2008/12/iphone-sdk-22-localizablestrings-bug/';
digg_bgcolor = '';
digg_skin = '';
digg_window = '';
digg_title = 'iPhone SDK 2.2 Localizable.strings bug';
digg_bodytext = '';
digg_media = '';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>In the latest release of the iPhone SDK 2.2 (9m2621) there is an issue concerning the localization procedure.</p>
<p>When the input string file is utf-8 and &#8220;Strings file Output Encoding&#8221; is set to binary, the resulting file isn&#8217;t Localizable.string but Localizable.string.XXXX where XXXX is a pid number.</p>
<p>To correct this issue you can patch the ruby script copystrings located in /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings.</p>
<p>Simply change line 134 from:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">system</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'plutil -convert binary1 -s -o &quot;'</span> <span style="color:#006600; font-weight:bold;">+</span> OPTIONS<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:OutputDir</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/'</span> <span style="color:#006600; font-weight:bold;">+</span> 
<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>path<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'&quot; -- &quot;'</span> <span style="color:#006600; font-weight:bold;">+</span> path <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'&quot;'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">system</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'plutil -convert binary1 -s -o &quot;'</span> <span style="color:#006600; font-weight:bold;">+</span> OPTIONS<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:OutputDir</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/'</span> <span style="color:#006600; font-weight:bold;">+</span> 
<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>path.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.#{Process.pid}&quot;</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'&quot; -- &quot;'</span> <span style="color:#006600; font-weight:bold;">+</span> path <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'&quot;'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gtsystem.eu/blog/2008/12/iphone-sdk-22-localizablestrings-bug/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
