<?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: C++ Convert Int to String Speed</title>
	<atom:link href="http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/feed/" rel="self" type="application/rss+xml" />
	<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/</link>
	<description>The words and ideas of Tino Didriksen</description>
	<lastBuildDate>Thu, 22 Sep 2011 00:51:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Roger</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-12393</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Thu, 07 Jul 2011 23:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-12393</guid>
		<description>@6, Jeff:
Unfortunately Qt doesn&#039;t have anything optimized. Qt is a library for easy and safe coding, it is far from optimized for speed. If anything Qt calls are MUCH slower than anything that&#039;s mentioned above. Qt function calls are anywhere from 2x up to 10x slower than the examples above, depending on what function you use.

If you don&#039;t believe me, do the tests yourself.
Also undocumented is the speed of some Qt functions. For examples from the QString class, the functions to convert to QByteArray.
::toLatin1() is actually the fastest, followed by ::toAscii() and the slowest being ::toLocal8Bit().

Qt has a lot, LOT of performance problems. If you&#039;re only writing applications that execute 20function calls a second, Qt is great because it allows for agile development. However if you&#039;re handling applications that execute millions of function calls every second, containing a few Qt calls in each of those functions, the performance problems become visible.</description>
		<content:encoded><![CDATA[<p>@6, Jeff:<br />
Unfortunately Qt doesn&#8217;t have anything optimized. Qt is a library for easy and safe coding, it is far from optimized for speed. If anything Qt calls are MUCH slower than anything that&#8217;s mentioned above. Qt function calls are anywhere from 2x up to 10x slower than the examples above, depending on what function you use.</p>
<p>If you don&#8217;t believe me, do the tests yourself.<br />
Also undocumented is the speed of some Qt functions. For examples from the QString class, the functions to convert to QByteArray.<br />
::toLatin1() is actually the fastest, followed by ::toAscii() and the slowest being ::toLocal8Bit().</p>
<p>Qt has a lot, LOT of performance problems. If you&#8217;re only writing applications that execute 20function calls a second, Qt is great because it allows for agile development. However if you&#8217;re handling applications that execute millions of function calls every second, containing a few Qt calls in each of those functions, the performance problems become visible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tino Didriksen</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-10536</link>
		<dc:creator>Tino Didriksen</dc:creator>
		<pubDate>Tue, 23 Nov 2010 02:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-10536</guid>
		<description>To get printf() formatting, I&#039;d suggest using &lt;a href=&quot;http://boost.org/doc/libs/release/libs/format&quot; rel=&quot;nofollow&quot;&gt;Boost Format&lt;/a&gt;. Whether that uses the fast Karma implementation, I dunno, but can read the documentation or ask &lt;a href=&quot;irc://irc.freenode.net/boost&quot; rel=&quot;nofollow&quot;&gt;Freenode&#039;s #boost&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>To get printf() formatting, I&#8217;d suggest using <a href="http://boost.org/doc/libs/release/libs/format" rel="nofollow">Boost Format</a>. Whether that uses the fast Karma implementation, I dunno, but can read the documentation or ask <a href="irc://irc.freenode.net/boost" rel="nofollow">Freenode&#8217;s #boost</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: QbProg</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-10516</link>
		<dc:creator>QbProg</dc:creator>
		<pubDate>Mon, 22 Nov 2010 09:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-10516</guid>
		<description>Hello there, 
I&#039;m just converting my old int-&gt;string routines using Karma :)
A little question:
i need to implement double-&gt;string and

generate(Buf, double_ , d);

works well.

Is there a quick way to specify the number of decimals?
I was using 
printf (&quot;%0.3f&quot;, myNumber)
to get 3 decimals numbers.

thank you!</description>
		<content:encoded><![CDATA[<p>Hello there,<br />
I&#8217;m just converting my old int-&gt;string routines using Karma :)<br />
A little question:<br />
i need to implement double-&gt;string and</p>
<p>generate(Buf, double_ , d);</p>
<p>works well.</p>
<p>Is there a quick way to specify the number of decimals?<br />
I was using<br />
printf (&#8220;%0.3f&#8221;, myNumber)<br />
to get 3 decimals numbers.</p>
<p>thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arash Partow</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-9228</link>
		<dc:creator>Arash Partow</dc:creator>
		<pubDate>Sun, 20 Jun 2010 22:39:19 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-9228</guid>
		<description>Have you considered including StrTk in your listings?

The tests used in that library are a little more extensive.
http://www.codeproject.com/KB/recipes/Tokenizer.aspx</description>
		<content:encoded><![CDATA[<p>Have you considered including StrTk in your listings?</p>
<p>The tests used in that library are a little more extensive.<br />
<a href="http://www.codeproject.com/KB/recipes/Tokenizer.aspx" rel="nofollow">http://www.codeproject.com/KB/recipes/Tokenizer.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8433</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 25 Mar 2010 13:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8433</guid>
		<description>How about Qt? They generally have things optimized pretty well.</description>
		<content:encoded><![CDATA[<p>How about Qt? They generally have things optimized pretty well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8346</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Fri, 12 Mar 2010 03:48:23 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8346</guid>
		<description>You should try against &#039;fast format&#039; too, for completeness - Matt Wilson&#039;s no slouch. 

http://www.fastformat.org/performance.html</description>
		<content:encoded><![CDATA[<p>You should try against &#8216;fast format&#8217; too, for completeness &#8211; Matt Wilson&#8217;s no slouch. </p>
<p><a href="http://www.fastformat.org/performance.html" rel="nofollow">http://www.fastformat.org/performance.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tino Didriksen</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8345</link>
		<dc:creator>Tino Didriksen</dc:creator>
		<pubDate>Thu, 11 Mar 2010 10:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8345</guid>
		<description>It has since been specialized for the basic integer and floating point types: http://www.boost.org/doc/libs/release/boost/lexical_cast.hpp (search for lcast_put_unsigned and below).

But for all other conversions, it is indeed dog slow. Just see http://tinodidriksen.com/2010/02/16/cpp-convert-string-to-int-speed/ where it trails by a huge margin.</description>
		<content:encoded><![CDATA[<p>It has since been specialized for the basic integer and floating point types: <a href="http://www.boost.org/doc/libs/release/boost/lexical_cast.hpp" rel="nofollow">http://www.boost.org/doc/libs/release/boost/lexical_cast.hpp</a> (search for lcast_put_unsigned and below).</p>
<p>But for all other conversions, it is indeed dog slow. Just see <a href="http://tinodidriksen.com/2010/02/16/cpp-convert-string-to-int-speed/" rel="nofollow">http://tinodidriksen.com/2010/02/16/cpp-convert-string-to-int-speed/</a> where it trails by a huge margin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arzar</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8344</link>
		<dc:creator>Arzar</dc:creator>
		<pubDate>Thu, 11 Mar 2010 10:04:34 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8344</guid>
		<description>I&#039;m quite surprised to see lexical_cast performing this good too.

Most of all, if you define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE the performance of lexical_cast increase even more. With MSCV10, I get ~30% instead of 70% !

(for reference, I get ~15% with itoa)</description>
		<content:encoded><![CDATA[<p>I&#8217;m quite surprised to see lexical_cast performing this good too.</p>
<p>Most of all, if you define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE the performance of lexical_cast increase even more. With MSCV10, I get ~30% instead of 70% !</p>
<p>(for reference, I get ~15% with itoa)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: indranil banerjee</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8339</link>
		<dc:creator>indranil banerjee</dc:creator>
		<pubDate>Wed, 10 Mar 2010 22:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8339</guid>
		<description>Interesting. Surprised to see that lexical_cast performed better than stringstream, I thought the former was implemented using the latter?

These results are quite contrary to the tests Sutter published back in 2001 http://www.gotw.ca/publications/mill19.htm. In those tests sprintf was the fastest, followed by strstream, stringstream &amp; lexical_cast trailing. Have things changed so much?</description>
		<content:encoded><![CDATA[<p>Interesting. Surprised to see that lexical_cast performed better than stringstream, I thought the former was implemented using the latter?</p>
<p>These results are quite contrary to the tests Sutter published back in 2001 <a href="http://www.gotw.ca/publications/mill19.htm" rel="nofollow">http://www.gotw.ca/publications/mill19.htm</a>. In those tests sprintf was the fastest, followed by strstream, stringstream &amp; lexical_cast trailing. Have things changed so much?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumant</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-8337</link>
		<dc:creator>Sumant</dc:creator>
		<pubDate>Wed, 10 Mar 2010 15:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-8337</guid>
		<description>Quite interesting! The performance results on g++ (4.4.3) hold as they are shown only when optimizations are turned on. With the increasing level of optimizations (-O1, -O2, -O3), performance improves.</description>
		<content:encoded><![CDATA[<p>Quite interesting! The performance results on g++ (4.4.3) hold as they are shown only when optimizations are turned on. With the increasing level of optimizations (-O1, -O2, -O3), performance improves.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

