This is the mail archive of the 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: [PATCH] PowerPC:strrchr() optimization

On 02/12/2014 11:04 PM, OndÅej BÃlka wrote:
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.

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?

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.


I have applied your changes in strrchr.c and modified the benchtest to search '/' character (with more than one occurances in various positions). Proposed ppc64 optimization is still running better than default. I have attached the results.


Attachment: strrchr_results.txt
Description: Text document

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