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 Compile cityhash code into libzfs 2020-03-27 09:11:22 -07:00
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 nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_deleg.c nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_fletcher_aarch64_neon.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_avx512.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_intel.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_sse.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_superscalar4.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_superscalar.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher.c Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-13 10:27:38 -05:00
zfs_namecheck.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
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 Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00