[PATCH v7 4/8] lib/string_kunit: add performance benchmark for strlen()
Kees Cook
kees at kernel.org
Fri Jan 30 09:35:42 PST 2026
On Fri, Jan 30, 2026 at 10:50:14AM +0800, Feng Jiang wrote:
> Introduce a benchmarking framework to the string_kunit test suite to
> measure the execution efficiency of string functions.
>
> The implementation is inspired by crc_benchmark(), measuring throughput
> (MB/s) and latency (ns/call) across a range of string lengths. It
> includes a warm-up phase, disables preemption during measurement, and
> uses a fixed seed for reproducible results.
>
> This framework allows for comparing different implementations (e.g.,
> generic C vs. architecture-optimized assembly) within the KUnit
> environment.
>
> Initially, provide a benchmark for strlen().
>
> Suggested-by: Andy Shevchenko <andy at kernel.org>
> Suggested-by: Eric Biggers <ebiggers at kernel.org>
> Signed-off-by: Feng Jiang <jiangfeng at kylinos.cn>
Reviewed-by: Kees Cook <kees at kernel.org>
--
Kees Cook
More information about the linux-riscv
mailing list