mirror_zfs/module/zcommon
rilysh e8f4592a19 Avoid computing strlen() inside loops
Compiling with -O0 (no proper optimizations), strlen() call
in loops for comparing the size, isn't being called/initialized
before the actual loop gets started, which causes n-numbers of
strlen() calls (as long as the string is). Keeping the length
before entering in the loop is a good idea.

On some places, even with -O2, both GCC and Clang can't
recognize this pattern, which seem to happen in an array
of char pointer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: rilysh <nightquick@proton.me>
Closes #16584
2024-11-05 15:43:52 -08:00
..
cityhash.c
simd_stat.c Add missing guard defines for simd_stat 2024-11-05 15:43:52 -08:00
zfeature_common.c Create zap for root vdev 2023-04-20 10:07:56 -07:00
zfs_comutil.c
zfs_deleg.c
zfs_fletcher_aarch64_neon.c
zfs_fletcher_avx512.c
zfs_fletcher_intel.c
zfs_fletcher_sse.c
zfs_fletcher_superscalar4.c
zfs_fletcher_superscalar.c
zfs_fletcher.c Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-13 10:27:38 -05:00
zfs_namecheck.c
zfs_prop.c Avoid computing strlen() inside loops 2024-11-05 15:43:52 -08:00
zpool_prop.c Avoid computing strlen() inside loops 2024-11-05 15:43:52 -08:00
zprop_common.c