This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: strstr benchtest.


On Thu, May 14, 2015 at 11:33:58AM +0200, Florian Weimer wrote:
> On 05/12/2015 11:09 PM, OndÅej BÃlka wrote:
> > Main problem of current benchtest was very biased input. I replaced that
> > with randomly generated ones that are closer to average case.
> 
> But strstr is not run on random strings.
> 
> Is there some easy way to generated traces of actual strstr arguments
> from a running system, perhaps using Systemtap?
>
Use my profiler here.

http://kam.mff.cuni.cz/~ondra/benchmark_string/strstr_profile250813.tar.bz2

But it won't help you much with this case. Haystacks are really short,
61% of calls end with match in first 16 bytes. See:

http://kam.mff.cuni.cz/~ondra/benchmark_string/profile/results/result.html strstr function
or
http://kam.mff.cuni.cz/~ondra/benchmark_string/i7_ivy_bridge/strstr_profile/results_gcc/result.html 

While its extremely valuable information and you should focus to
optimize header it would probably report little change as both
implementations just do initial strchr.

Longer strings where you could see improvement don't exist in practice.
So you are left with generating some data.


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