This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC:strrchr() optimization
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 12 Feb 2014 18:34:01 +0100
- Subject: Re: [PATCH] PowerPC:strrchr() optimization
- Authentication-results: sourceware.org; auth=none
- References: <1391774914-21585-1-git-send-email-raji at linux dot vnet dot ibm dot com> <52F86DF5 dot 8030500 at linux dot vnet dot ibm dot com>
On Mon, Feb 10, 2014 at 11:43:09AM +0530, Rajalakshmi Srinivasaraghavan wrote:
> Hi All
>
> This patch optimizes strrchr() for ppc64. I have attached the benchtest
> output to show the performance improvement.This is coded with strchr.S as reference and uses
> cmpb instruction for speed improvement.
Hi,
There is one thing to check as strrchr could be genericaly implemented
by other primitives.
I send a patch for that, could you check how does that compare?
https://sourceware.org/ml/libc-alpha/2013-10/msg00201.html
Benchmarking strrchr is bit tricky as performance depends on frequency
of searched character. I did profiling and most common usecase is
finding trailing / in pathnames. Typically a result is between 10 and 20
characters from start. See following for more statistic.
http://kam.mff.cuni.cz/~ondra/benchmark_string/i7_ivy_bridge/strrchr_profile/results_gcc/result.html