mirror_zfs/module/zcommon
Richard Yao 59493b63c1
Micro-optimize fletcher4 calculations
When processing abds, we execute 1 `kfpu_begin()`/`kfpu_end()` pair on
every page in the abd. This is wasteful and slows down checksum
performance versus what the benchmark claimed. We correct this by moving
those calls to the init and fini functions.

Also, we always check the buffer length against 0 before calling the
non-scalar checksum functions. This means that we do not need to execute
the loop condition for the first loop iteration. That allows us to
micro-optimize the checksum calculations by switching to do-while loops.

Note that we do not apply that micro-optimization to the scalar
implementation because there is no check in
`fletcher_4_incremental_native()`/`fletcher_4_incremental_byteswap()`
against 0 sized buffers being passed.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14247
2022-12-05 11:00:34 -08:00
..
cityhash.c Compile cityhash code into libzfs 2020-03-27 09:11:22 -07:00
zfeature_common.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_comutil.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_deleg.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_fletcher_aarch64_neon.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher_avx512.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher_intel.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher_sse.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher_superscalar4.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher_superscalar.c Micro-optimize fletcher4 calculations 2022-12-05 11:00:34 -08:00
zfs_fletcher.c Convert some sprintf() calls to kmem_scnprintf() 2022-11-28 13:49:58 -08:00
zfs_namecheck.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_prop.c dsl_prop_known_index(): check for invalid prop 2022-11-08 10:16:01 -08:00
zpool_prop.c Allow to control failfast 2022-11-10 13:37:12 -08:00
zprop_common.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00