Re: [Boost-bugs] [Boost C++ Libraries] #3218: string_algo algorithms are quite slow in some popular compiler/OS/hardware situations

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3218: string_algo algorithms are quite slow in some popular compiler/OS/hardware situations
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-04 06:54:15


#3218: string_algo algorithms are quite slow in some popular compiler/OS/hardware
situations
-------------------------------------------------------+--------------------
  Reporter: Yuri Goldfeld <yuri_goldfeld@…> | Owner: marshall
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: algorithm
   Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords: performance string_algo strings
-------------------------------------------------------+--------------------
Changes (by marshall):

  * status: new => assigned

Comment:

 I tried Stephen's test on my Mac (gcc 4.2), both with and without his
 comparison predicate

 {{{
 StartsWithI(string("abcdefghi"), "aBcD")| 471 msec.
 istarts_with(string("abcdefghi"), "aBcD")| 1060 msec.
 Boost/hand ratio = 2.25053

 EqualsI("abcdefghi", "aBcDeFgHi")| 274 msec.
 iequals("abcdefghi", "aBcDeFgHi")| 989 msec.
 Boost/hand ratio = 3.60949

 ----
 StartsWithI(string("abcdefghi"), "aBcD")| 450 msec.
 starts_with(string("abcdefghi"), "aBcD", iequal_pred ())| 575 msec.
 Boost/hand ratio = 1.27778

 EqualsI("abcdefghi", "aBcDeFgHi")| 253 msec.
 equals("abcdefghi", "aBcDeFgHi", iequal_pred ())| 262 msec.
 Boost/hand ratio = 1.03557
 }}}

 I will try on a Windows machine (well, VM) as well, but it looks like when
 you compare apples to apples, Boost.StringAlgo is not substantially slower
 than the hand-rolled code; rather, the performance difference was that the
 two routines were doing different kinds of comparisons - one was using
 std::tolower, while the other was using the locale system.

 if I find the same thing on Windows, I will close this bug, especially
 since there's a simple way to use std::tolower for the conversions where
 speed is a priority.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3218#comment:13>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC