This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: on the speed of std::string::find


Am Dienstag, den 05.09.2006, 11:44 +0200 schrieb Dennis Lubert:
> Am Dienstag, den 05.09.2006, 10:42 +0200 schrieb Paolo Carlini:
> > 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. 
> Sorry, you are right of course. I shouldn't do such tests at 3am.
> http://www.projectiwear.org/~plasmahh/string_bench_new.png
> These are the new results, and indeed the new implementation has nearly
> identical performance to memmem. The tests denote the speed (yaxis)
> against the position within a string to search for. The length of the
> string to be searched for is fixed to 10. I will do some tests on how
> the new implementation scales against longer strings to be searched for,
> but I am very confident that it also scales better here, leading to a
> much better overall performance for all cases.
http://www.projectiwear.org/~plasmahh/string_bench_both.png
This is an update on the benchmarks. Sorry, it looks a bit crowded, but
nevertheless shows the relevant numbers. The new three lines show how
the different algorithms scale when the length of the string to be
searched for gets longer. So the new one scales nearly equally well to
the memmem implementations in both regards, and I think that the patch
is a huge improvement. If you still need further tests, let me know
about the details that shall be tested.

greets

Dennis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]