Optimized implementation of strnlen() in RISC-V assembly
Performance was measured using strperf on a HiFive Unmatched (SiFive HF105-001) board.
os: FreeBSD arch: riscv │ strnlen_baseline │ strnlen_scalar │ │ sec/op │ sec/op vs base │ Short 787.0µ ± 0% 430.9µ ± 1% -45.24% (p=0.000 n=20) Mid 621.6µ ± 0% 195.1µ ± 1% -68.61% (p=0.000 n=20) Long 569.4µ ± 1% 100.6µ ± 0% -82.34% (p=0.000 n=20) geomean 653.1µ 203.7µ -68.81% │ strnlen_baseline │ strnlen_scalar │ │ MiB/s │ MiB/s vs base │ Short 158.8 ± 0% 290.1 ± 1% +82.62% (p=0.000 n=20) Mid 201.1 ± 0% 640.6 ± 1% +218.59% (p=0.000 n=20) Long 219.5 ± 1% 1242.9 ± 0% +466.19% (p=0.000 n=20) geomean 191.4 613.5 +220.57%