Jerry Jelinek got a fish trophy!
10809 Performance optimization of AVL tree comparator functions
Review Request #1771 - Created April 18, 2019 and submitted
This is a port from ZoL of
ee36c709c3d Performance optimization of AVL tree comparator functions
I copied the performance results from the ZoL commit message into the bug report.
|We should not just call into __builtin_expect everywhere. This should be rigged up in sys/ccompile.h as a macro like other ...||Robert Mustacchi|
|Should these be documented as part of libavl(3AVL) and avl(9F)?||Robert Mustacchi|
|I think we should probably consider keeping these as undocumented for the time being.||Robert Mustacchi|
|Rather than avl, should we use zfs here and in the userland header?||Robert Mustacchi|
I didn't go through all of these, but I think the typing isn't right on almost all of these. In many cases the AVL_CMP macro is taking the raw types and always assigning it to an int, truncating it in the process. I'm not sure this is sound. I stopped auditing them all, because it seeemd true of almost all of them.
We should not just call into __builtin_expect everywhere. This should be rigged up in sys/ccompile.h as a macro like other compiler specific flags to make sure that when it's not present, we basically just only have x output.
We're subtracting two uint64_t values, why is an int the right type for this?
This is truncating a uint64_t to an int, I don't believe that's right.
This is converting off_t to an int, I don't believe that's right.
Should these be documented as part of libavl(3AVL) and avl(9F)?
I've updated the patch to add the compiler guards and new/updated man page changes.
Revision 2 (+254 -268)
I've removed the man page related changes that I added in the previous diff and I changed the _avl_expect macro to _zfs_expect.