This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: on the speed of std::string::find
Dennis Lubert wrote:
Right, that is a good point. Embedded \0 is what I overlooked in why it
cannot using strstr. After searching for a while, I have found the GNU
function memmem, and replacing my calls with that leads to factors
between 2 and 10 for memmem beeing still faster than std::string::find.
memmem could also be used for the other variants of find, since it takes
size parameters. Now the question is, if the libstdc++ can rely on
extensions to the libc only beein in the glibc? At least it could try to
detect if the extension is there and then use it. I mean, the libstdc++
is a gnu library... though I don't know much about on what it can rely
and on what not.
Likewise good point ;) Yes, in various parts of the library, locale for
instance, we are putting to good use very convenient gnu extensions,
therefore the plan makes sense. Well, we have to study the issue a bit
more and see whether the added complexity is worth the improvement (from
a maintainance point of view too).
Thanks anyway,
Paolo.