[Bug libstdc++/66414] Regression: string::find ten times slower than strstr

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 5 10:41:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66414

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-12-05
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think we can simply hoist the code out into a helper function and then
overload that for the common char_traits<char> and char_traits<wchar_t> cases,
where we know the char_traits doesn't do anything funky and we can forward to
optimized libc calls. The generic version can't do that.


More information about the Gcc-bugs mailing list