freebsd-nq/cddl/contrib/opensolaris/lib/libzfs/common
Matt Macy 648cfe57fd Performance optimization of AVL tree comparator functions
MFV:
commit ee36c709c3
Author: Gvozden Neskovic <neskovic@gmail.com>
Date:   Sat Aug 27 20:12:53 2016 +0200

    perf: 2.75x faster ddt_entry_compare()
        First 256bits of ddt_key_t is a block checksum, which are expected
    to be close to random data. Hence, on average, comparison only needs to
    look at first few bytes of the keys. To reduce number of conditional
    jump instructions, the result is computed as: sign(memcmp(k1, k2)).

    Sign of an integer 'a' can be obtained as: `(0 < a) - (a < 0)` := {-1, 0, 1} ,
    which is computed efficiently.  Synthetic performance evaluation of
    original and new algorithm over 1G random keys on 2.6GHz Intel(R) Xeon(R)
    CPU E5-2660 v3:

    old     6.85789 s
    new     2.49089 s

    perf: 2.8x faster vdev_queue_offset_compare() and vdev_queue_timestamp_compare()
        Compute the result directly instead of using conditionals

    perf: zfs_range_compare()
        Speedup between 1.1x - 2.5x, depending on compiler version and
    optimization level.

    perf: spa_error_entry_compare()
        `bcmp()` is not suitable for comparator use. Use `memcmp()` instead.

    perf: 2.8x faster metaslab_compare() and metaslab_rangesize_compare()
    perf: 2.8x faster zil_bp_compare()
    perf: 2.8x faster mze_compare()
    perf: faster dbuf_compare()
    perf: faster compares in spa_misc
    perf: 2.8x faster layout_hash_compare()
    perf: 2.8x faster space_reftree_compare()
    perf: libzfs: faster avl tree comparators
    perf: guid_compare()
    perf: dsl_deadlist_compare()
    perf: perm_set_compare()
    perf: 2x faster range_tree_seg_compare()
    perf: faster unique_compare()
    perf: faster vdev_cache _compare()
    perf: faster vdev_uberblock_compare()
    perf: faster fuid _compare()
    perf: faster zfs_znode_hold_compare()

    Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
    Signed-off-by: Richard Elling <richard.elling@gmail.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes #5033
2018-08-10 06:42:08 +00:00
..
libzfs_changelist.c MFV r316926: 2018-08-01 21:51:49 +00:00
libzfs_compat.c Add compat shim part missed at r305197. 2017-08-02 10:33:47 +00:00
libzfs_compat.h
libzfs_config.c MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a" 2016-09-01 14:52:05 +00:00
libzfs_dataset.c Performance optimization of AVL tree comparator functions 2018-08-10 06:42:08 +00:00
libzfs_diff.c MFV r337014: 2018-07-31 22:50:50 +00:00
libzfs_fru.c MFV r316693: 2017-04-10 22:56:38 +00:00
libzfs_impl.h MFV r316926: 2018-08-01 21:51:49 +00:00
libzfs_import.c MFV r337184: 9457 libzfs_import.c:add_config() has a memory leak 2018-08-02 21:25:32 +00:00
libzfs_iter.c Performance optimization of AVL tree comparator functions 2018-08-10 06:42:08 +00:00
libzfs_mount.c MFV r316926: 2018-08-01 21:51:49 +00:00
libzfs_pool.c MFV r336991, r337001: 2018-07-31 21:06:04 +00:00
libzfs_sendrecv.c Performance optimization of AVL tree comparator functions 2018-08-10 06:42:08 +00:00
libzfs_status.c This originated from ZFS On Linux, as 2018-06-08 17:38:28 +00:00
libzfs_util.c MFV r336991, r337001: 2018-07-31 21:06:04 +00:00
libzfs.h MFV r316926: 2018-08-01 21:51:49 +00:00