on the speed of std::string::find

Paolo Carlini pcarlini@suse.de
Tue Sep 5 08:41:00 GMT 2006


Dennis Lubert wrote:

>Hi, I did some simple benchmarks with the different implementation.
>yours is the "new find patch" implementation, which seems to be a bit
>faster at start, but scales worse. I didn't had enough time today, but I
>think within the next few days I can build up a few charts with
>descriptions of what I exactly did etc. pp.
>http://www.projectiwear.org/~plasmahh/string_bench_simple.png
>  
>
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. I'm saying that because the "new" implementation is 
*identical* to glibc' memmem, the difference should be withing a few % 
(indeed, the timings I'm seeing on many different machines are 
consistent with those your reported days ago, certainly about 1.5-2.0 x 
faster than the current implementation). Also, please use many different 
strings: either use our performance testcase or a bi amount of *real* data.

Please let me know ASAP if you are able to conduct such kind of tests, 
otherwise we are delaying unnecessarily closing the issue, thanks
Paolo.



More information about the Libstdc++ mailing list