on the speed of std::string::find
Paolo Carlini
pcarlini@suse.de
Tue Sep 5 08:46:00 GMT 2006
Paolo Carlini wrote:
> Dennis, thanks for your help, but something is certainly wrong in the
> benchmarking, we can't trust it. Likely, it's because of the
> optimization level, or something else. As I said already, you must use
> -O2, otherwise we are measuring something which nobody will see in
> practice.
Just to say one, without inlining at -O0, going through type_traits (the
tiny eq, in particular) means function calls which are certainly heavy
to do for each char. This thing alone makes the "new" implementation
appear much slower than memmem where the algorithm is in fact the same.
Paolo.
More information about the Libstdc++
mailing list