<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ever wonder which is the fastest way to concatenate strings in Python?</title>
	<atom:link href="http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python/feed" rel="self" type="application/rss+xml" />
	<link>http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python</link>
	<description>The personal weblog of Peter Hosey.</description>
	<lastBuildDate>Wed, 09 May 2012 18:26:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python/comment-page-1#comment-40821</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Tue, 08 May 2007 02:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python#comment-40821</guid>
		<description>&lt;p&gt;David: &lt;a href=&quot;http://boredzo.org/blog/wp-content/uploads/2007/05/time_concatenation_unicodepy.bz2&quot; rel=&quot;nofollow&quot;&gt;Here you go&lt;/a&gt;. The % operator still wins with Unicode strings.&lt;/p&gt;

&lt;p&gt;WRT assuming the presence of the + optimization: I think it makes less sense to assume that % is faster. + is the concatenation operator, so it&#039;s reasonable to assume that that&#039;s the best way to concatenate; until 2.4, that wasn&#039;t true, but now it is (for plain strings).&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>David: <a href="http://boredzo.org/blog/wp-content/uploads/2007/05/time_concatenation_unicodepy.bz2" rel="nofollow">Here you go</a>. The % operator still wins with Unicode strings.</p>
<p>WRT assuming the presence of the + optimization: I think it makes less sense to assume that % is faster. + is the concatenation operator, so it&#8217;s reasonable to assume that that&#8217;s the best way to concatenate; until 2.4, that wasn&#8217;t true, but now it is (for plain strings).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Smith</title>
		<link>http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python/comment-page-1#comment-40790</link>
		<dc:creator>David Smith</dc:creator>
		<pubDate>Tue, 08 May 2007 01:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python#comment-40790</guid>
		<description>Looking at Chris&#039;s explanation, I&#039;m not so sure that this optimization is quite the panacea your benchmark would imply it is...

&quot;Here&#039;s the summary: counting on this optimization is unwise, as it turns out to depend on low-level details of system memory allocation that can vary from system to system and workload to workload. Also, this is only for plain (byte) strings, not for Unicode strings; as of Python 2.4.2, Unicode string concatenation remains un-optimized.&quot;

Perhaps we could get a new set of benchmark timings with unicode strings?</description>
		<content:encoded><![CDATA[<p>Looking at Chris&#8217;s explanation, I&#8217;m not so sure that this optimization is quite the panacea your benchmark would imply it is&#8230;</p>
<p>&#8220;Here&#8217;s the summary: counting on this optimization is unwise, as it turns out to depend on low-level details of system memory allocation that can vary from system to system and workload to workload. Also, this is only for plain (byte) strings, not for Unicode strings; as of Python 2.4.2, Unicode string concatenation remains un-optimized.&#8221;</p>
<p>Perhaps we could get a new set of benchmark timings with unicode strings?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: huwr</title>
		<link>http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python/comment-page-1#comment-39883</link>
		<dc:creator>huwr</dc:creator>
		<pubDate>Mon, 07 May 2007 07:36:42 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-05-06/ever-wonder-which-is-the-fastest-way-to-concatenate-strings-in-python#comment-39883</guid>
		<description>That&#039;s cool. Here are the results from my 2.0GHz Core Duo MacBook Pro:

+: 0.512433052063
str.join(list): 0.9431848526
str.join(tuple): 0.859102964401
%: 0.936084985733
--Alternate versions that don&#039;t re-create the string every time--
+: 0.50304889679
str.join(list): 0.887317895889
str.join(tuple): 0.794829130173
%: 0.89204788208</description>
		<content:encoded><![CDATA[<p>That&#8217;s cool. Here are the results from my 2.0GHz Core Duo MacBook Pro:</p>
<p>+: 0.512433052063<br />
str.join(list): 0.9431848526<br />
str.join(tuple): 0.859102964401<br />
%: 0.936084985733<br />
&#8211;Alternate versions that don&#8217;t re-create the string every time&#8211;<br />
+: 0.50304889679<br />
str.join(list): 0.887317895889<br />
str.join(tuple): 0.794829130173<br />
%: 0.89204788208</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.128 seconds -->

