[PING][PATCH] More effective generic strrchr.
Ondřej Bílka
neleai@seznam.cz
Sun Jun 7 15:00:00 GMT 2015
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.
More information about the Libc-alpha
mailing list