mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-29 04:19:35 +03:00
677c6f8457
This implements a binary search algorithm for B-Trees that reduces branching to the absolute minimum necessary for a binary search algorithm. It also enables the compiler to inline the comparator to ensure that the only slowdown when doing binary search is from waiting for memory accesses. Additionally, it instructs the compiler to unroll the loop, which gives an additional 40% improve with Clang and 8% improvement with GCC. Consumers must opt into using the faster algorithm. At present, only B-Trees used inside kernel code have been modified to use the faster algorithm. Micro-benchmarks suggest that this can improve binary search performance by up to 3.5 times when compiling with Clang 16 and up to 1.9 times when compiling with GCC 12.2. 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 #14866 |
||
---|---|---|
.. | ||
checksum | ||
file | ||
linux_dos_attributes | ||
.gitignore | ||
badsend.c | ||
btree_test.c | ||
chg_usr_exec.c | ||
cp_files.c | ||
ctime.c | ||
devname2devid.c | ||
dir_rd_update.c | ||
dosmode_readonly_write.c | ||
draid.c | ||
ereports.c | ||
get_diff.c | ||
getversion.c | ||
idmap_util.c | ||
libzfs_input_check.c | ||
Makefile.am | ||
mkbusy.c | ||
mkfile.c | ||
mkfiles.c | ||
mktree.c | ||
mmap_exec.c | ||
mmap_libaio.c | ||
mmap_seek.c | ||
mmap_sync.c | ||
mmapwrite.c | ||
nvlist_to_lua.c | ||
readmmap.c | ||
rename_dir.c | ||
renameat2.c | ||
rm_lnkcnt_zero_file.c | ||
send_doall.c | ||
stride_dd.c | ||
suid_write_to_file.c | ||
threadsappend.c | ||
truncate_test.c | ||
user_ns_exec.c | ||
xattrtest.c | ||
zed_fd_spill-zedlet.c | ||
zfs_diff-socket.c |