HomeFreeBSD

AVL: Remove obsolete branching optimizations

Description

AVL: Remove obsolete branching optimizations

Modern Clang and GCC can successfully implement simple conditions
without branching with math and flag operations. Use of arrays for
translation no longer helps as much as it was 14+ years ago.

Disassemble of the code generated by Clang 13.0.0 on FreeBSD 13.1,
Clang 14.0.4 on FreeBSD 14 and GCC 10.2.1 on Debian 11 with this
change still shows no branching instructions.

Profiling of CPU-bound scan stage of sorted scrub shows reproducible
reduction of time spent inside avl_find() from 6.52% to 4.58%.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13540

Details

Provenance
mavAuthored on Jun 9 2022, 10:27 PM
GitHub <noreply@github.com>Committed on Jun 9 2022, 10:27 PM
Parents
rGcdeb98a116a3: libzfs: Rename msg bufs to errbuf for consistency
Branches
Unknown
Tags
Unknown