[PATCH v3 5/8] lib/string_kunit: extend benchmarks to strnlen and chr searches

Feng Jiang jiangfeng at kylinos.cn
Tue Jan 20 21:48:13 PST 2026


On 2026/1/20 15:48, Andy Shevchenko wrote:
> On Tue, Jan 20, 2026 at 02:58:49PM +0800, Feng Jiang wrote:
>> Extend the string benchmarking suite to include strnlen(), strchr(),
>> and strrchr().
>>
>> For character search functions (strchr and strrchr), the benchmark
> 
> strchr() and strrchr()

Will fix.

>> targets the null terminator. This ensures the entire string is scanned,
> 
> NUL character
> 
> (Also check terminology everywhere: NULL — is for NULL pointers, NUL is for
>  '\0' characters.)
> 

Thanks for the correction, I'll fix this and check other places as well.

>> providing a consistent measure of full-length processing efficiency
>> comparable to strlen().
> 
> Acked-by: Andy Shevchenko <andy at kernel.org>
> 

-- 
With Best Regards,
Feng Jiang




More information about the linux-riscv mailing list