<?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>Tue, 17 Apr 2012 21:03:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Tino Didriksen</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-12552</link>
		<dc:creator>Tino Didriksen</dc:creator>
		<pubDate>Tue, 17 Apr 2012 21:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-12552</guid>
		<description>It&#039;s already shown in the post where it says &quot;Source for the test is at speed-convert-int-to-string.cpp with cycle.h.&quot;
( http://tinodidriksen.com/uploads/code/cpp/speed-convert-int-to-string.cpp + http://tinodidriksen.com/uploads/code/cpp/cycle.h )</description>
		<content:encoded><![CDATA[<p>It&#8217;s already shown in the post where it says &#8220;Source for the test is at speed-convert-int-to-string.cpp with cycle.h.&#8221;<br />
( <a href="http://tinodidriksen.com/uploads/code/cpp/speed-convert-int-to-string.cpp" rel="nofollow">http://tinodidriksen.com/uploads/code/cpp/speed-convert-int-to-string.cpp</a> + <a href="http://tinodidriksen.com/uploads/code/cpp/cycle.h" rel="nofollow">http://tinodidriksen.com/uploads/code/cpp/cycle.h</a> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://tinodidriksen.com/2010/02/07/cpp-convert-int-to-string-speed/#comment-12551</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 17 Apr 2012 20:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://tinodidriksen.com/?p=202#comment-12551</guid>
		<description>Hi, can you show source code, on which you tested speed of conversion from int to string?</description>
		<content:encoded><![CDATA[<p>Hi, can you show source code, on which you tested speed of conversion from int to string?</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>

