This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING][PATCH] More effective generic strrchr.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Richard Earnshaw <rearnsha at arm dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Wed, 12 Aug 2015 08:22:22 +0200
- Subject: Re: [PING][PATCH] More effective generic strrchr.
- Authentication-results: sourceware.org; auth=none
- References: <20131005071542 dot GA13382 at domone> <20150107115537 dot GA31981 at domone> <54AD213F dot 2060907 at arm dot com> <20150607133819 dot GA6273 at domone>
On Sun, Jun 07, 2015 at 03:38:19PM +0200, OndÅej BÃlka wrote:
> On Wed, Jan 07, 2015 at 12:06:23PM +0000, Richard Earnshaw wrote:
> > On 07/01/15 11:55, OndÅej BÃlka wrote:
> > > [PING]
> >
> > Looks sensible to me.
> >
> > It would be useful if some of the bench tests were based on degenerate
> > examples.
> >
> > R.
> >
> Sorry that I didn't originally noticed this mail until I returned to
> strrchr again. I commented that benchmark is pretty meaningless as
> performance depends on empirical variable and each implementation could
> be best with it suitably choosen.
>
> Here its average number of occurences of c, if thats close to zero then
> strchr would be faster in just finding terminating zero. You need to
> have one c on average for this be worthwhile.
>
> As my test data I used start of glibc make. That shows most strrchr
> calls. These with test that replays these with same pattern of c matches
> is here.
>
> http://kam.mff.cuni.cz/~ondra/dryrun_strrchr.tar.bz2
>
> It shows considerable speedup, I don't know exactly yet as I need to
> subtract construction overhead.
As also Wilco said its improvement I plan to commit this tommorow if
nobody objects.