Re: [PATCH] un-improve strrchr()

2015-07-01 Thread Alexey Dobriyan
On Wed, Jul 1, 2015 at 2:52 AM, Chris Rorvick wrote: > [ resending w/o HTML formatting ] > > On Sun, Jun 28, 2015 at 11:44 AM, Alexey Dobriyan wrote: >> Previous code did 1 branch per character + 1 branch for every character >> in the last path component. Current code does 2 branches per charache

Re: [PATCH] un-improve strrchr()

2015-06-30 Thread Chris Rorvick
[ resending w/o HTML formatting ] On Sun, Jun 28, 2015 at 11:44 AM, Alexey Dobriyan wrote: > Previous code did 1 branch per character + 1 branch for every character > in the last path component. Current code does 2 branches per characher > regardless. Shouldn't that be "+ 2 branches for every ch

Re: [PATCH] un-improve strrchr()

2015-06-28 Thread Alexey Dobriyan
Joe Perches wrote: > On Sun, 2015-06-28 at 19:44 +0300, Alexey Dobriyan wrote: > > Commit 8da53d4595a53fb9a3380dd4d1c9bc24c7c9aab8 > > ("lib/string.c: improve strrchr()") changed strrchr() implementation > > from "rewind to the end and search backwards" to "search forward" > > optimizing for chara

Re: [PATCH] un-improve strrchr()

2015-06-28 Thread Joe Perches
On Sun, 2015-06-28 at 19:44 +0300, Alexey Dobriyan wrote: > Commit 8da53d4595a53fb9a3380dd4d1c9bc24c7c9aab8 > ("lib/string.c: improve strrchr()") changed strrchr() implementation > from "rewind to the end and search backwards" to "search forward" > optimizing for characher not found case. However,

[PATCH] un-improve strrchr()

2015-06-28 Thread Alexey Dobriyan
Commit 8da53d4595a53fb9a3380dd4d1c9bc24c7c9aab8 ("lib/string.c: improve strrchr()") changed strrchr() implementation from "rewind to the end and search backwards" to "search forward" optimizing for characher not found case. However, common case is exactly the opposite: string is absolute pathname,