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] ARM: Add optimized ARMv7 strcmp implementation

On Wed, 23 Apr 2014, Will Newton wrote:

> Add an optimized implementation of strcmp for ARMv7-A cores. This
> implementation is significantly faster than the current generic C
> implementation, particularly for strings of 16 bytes and longer.

Could you please describe the testing (at least the string/ tests should 
have been run for both endiannesses) and be more specific about 
"significantly faster" (benchmark results - on specific identified 
hardware - using glibc's benchtests are desirable for such string function 
tests, in addition to any other benchmarks you may have used if glibc's 
benchtests aren't useful for the cases of interest)?

> +/* Build Options:
> +   STRCMP_NO_PRECHECK: Don't run a quick pre-check of the first
> +   byte in the string.  If comparing completely random strings
> +   the pre-check will save time, since there is a very high
> +   probability of a mismatch in the first character: we save
> +   significant overhead if this is the common case.  However,
> +   if strings are likely to be identical (eg because we're
> +   verifying a hit in a hash table), then this check is largely
> +   redundant.  */
> +

In general I think it's clearer to have such macros in the positive sense, 
i.e. STRCMP_PRECHECK (value 1) instead of STRCMP_NO_PRECHECK (value 0).

Joseph S. Myers

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