Boost C++ Libraries: Ticket #7494: boost::replace_all is very slow on debug build when Format size is big https://svn.boost.org/trac10/ticket/7494 <p> Method boost::replace_all(SequenceT&amp; Input, const Range1T&amp; Search, const Range2T&amp; Format) on debug build takes very long time when Format size is about 300k. On call stack I can see push_front for every char. </p> <p> When I use std::find and std::replace in loop it is cca 10 times faster. </p> <p> I have Boost library 1.45, Visual Studio 2010, Win7 x64 SP1, 6-core CPU. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7494 Trac 1.4.3 Jan Vonasek <jan.vonasek@…> Thu, 11 Oct 2012 09:34:59 GMT <link>https://svn.boost.org/trac10/ticket/7494#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7494#comment:1</guid> <description> <p> deque::_Insert is used and it contains </p> <blockquote> <p> for (; _First != _Last; ++_First) </p> <blockquote> <p> push_front(*_First); <em> prepend flipped </em></p> </blockquote> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 17 Dec 2012 17:24:00 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/7494#comment:2 https://svn.boost.org/trac10/ticket/7494#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Can you send me a test program, please? </p> Ticket Jan Vonasek <jan.vonasek@…> Mon, 17 Dec 2012 19:21:47 GMT <link>https://svn.boost.org/trac10/ticket/7494#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7494#comment:3</guid> <description> <p> Sample code: std::wstring sInput = cca 20kB text (HTML template containing texts like "ImagePath1", "ImagePath2",...); std::wstring sFormat1 = cca 300kB text (base64 encoded image); boost::replace_all(sInput, L"ImagePath1", sFormat1); std::wstring sFormat2 = cca 300kB text (base64 encoded image); boost::replace_all(sInput, L"ImagePath2", sFormat2); </p> </description> <category>Ticket</category> </item> <item> <author>Jan Vonasek <jan.vonasek@…></author> <pubDate>Mon, 17 Dec 2012 19:25:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7494#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7494#comment:4</guid> <description> <p> Sample code: </p> <pre class="wiki">std::wstring sInput = cca 20kB text (HTML template containing texts like "ImagePath1", "ImagePath2",...); std::wstring sFormat1 = cca 300kB text (base64 encoded image); boost::replace_all(sInput, L"ImagePath1", sFormat1); std::wstring sFormat2 = cca 300kB text (base64 encoded image); boost::replace_all(sInput, L"ImagePath2", sFormat2); </pre> </description> <category>Ticket</category> </item> <item> <author>Alexander Zaitsev <zamazan4ik@…></author> <pubDate>Mon, 11 Jul 2016 21:34:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7494#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7494#comment:5</guid> <description> <p> Do we need to fix it in Boost 1.61? Or it maybe already fixed? </p> </description> <category>Ticket</category> </item> </channel> </rss>