Boost C++ Libraries: Ticket #5350: Patch for lexical_cast: additional optimizations https://svn.boost.org/trac10/ticket/5350 <p> Patch to Boost Lexical Cast library, that returns Target directly constructed from Source in cases, when:<br /> 1) Source and Target are arithmetics (and not char or wchar_t), and all values of Source are in range of Target<br /> 2) Source and Target are both char or both wchar_t<br /> 3) Source is array of CharT and Target is std::basic_string&lt;CharT, ...&gt;<br /> 4) Source and Target are std::basic_string with same template parameters<br /> </p> <p> It gives performance boost more than 10 times in case 1), about 7 times in case 2), and about 1.5 times in cases 3) and 4). </p> <p> Existing tests for Boost Lexical Cast library cover considered cases. Patch was successfully tested on Intel 11.1.072, g++-4.4.5, VC++9 compilers. </p> <p> It has the same behaviour, when casting out of bounds (int -&gt; unsigned int, int -&gt; short, unsigned int -&gt; int). For checking bounds it uses boost::numeric::conversion_traits from &lt;boost/numeric/conversion/conversion_traits.hpp&gt; </p> <p> Closes the ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4397" title="#4397: Feature Requests: specialization for lexical_cas for identical Target and Source types (closed: fixed)">#4397</a><br /> </p> <p> Was discussed at <a class="ext-link" href="http://lists.boost.org/Archives/boost/2011/03/178882.php"><span class="icon">​</span>Boost mailing list</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5350 Trac 1.4.3 Antony Polukhin <antoshkka@…> Mon, 21 Mar 2011 19:32:09 GMT attachment set https://svn.boost.org/trac10/ticket/5350 https://svn.boost.org/trac10/ticket/5350 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">lexical_cast.hpp.diff</span> </li> </ul> <p> Patch for trunk version of lexical_cast (for revision 70337) </p> Ticket Antony Polukhin Fri, 13 May 2011 09:57:09 GMT owner, status changed https://svn.boost.org/trac10/ticket/5350#comment:1 https://svn.boost.org/trac10/ticket/5350#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">nasonov</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Antony Polukhin Sun, 15 May 2011 15:52:31 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/5350#comment:2 https://svn.boost.org/trac10/ticket/5350#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.47.0</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71958" title="Fixes #5417. Fixes #4397 More tests (for conversions to float types, ...">[71958]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5350" title="#5350: Patches: Patch for lexical_cast: additional optimizations (closed: fixed)">#5350</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4397" title="#4397: Feature Requests: specialization for lexical_cas for identical Target and Source types (closed: fixed)">#4397</a> More tests (for conversions to float types, for conversions of negative values to unsigned integers) </p> <p> When aws commiting to svn, supported the wrong number. </p> Ticket anonymous Mon, 27 Feb 2012 22:27:42 GMT <link>https://svn.boost.org/trac10/ticket/5350#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5350#comment:3</guid> <description> <p> More details at <a class="ext-link" href="http://www.youtube.com/watch?v=XPpXll4GmwE"><span class="icon">​</span>http://www.youtube.com/watch?v=XPpXll4GmwE</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>