mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-26 00:27:54 -04:00
Instead of shifting the XOR value right and comparing it to 1, which
roughly requires 2 sequential instructions, better test if the XOR has
any bit above the current bit, which means any bit set among those
strictly higher, or in other words that XOR & (-bit << 1) is non-zero.
This is one less instruction in the fast path and gives another nice
performance gain on random keys (in million lookups/s):
eb32 1k: 33.17 -> 37.30 +12.5%
10k: 15.74 -> 17.08 +8.51%
100k: 8.00 -> 9.00 +12.5%
eb64 1k: 34.40 -> 38.10 +10.8%
10k: 16.17 -> 17.10 +5.75%
100k: 8.38 -> 8.87 +5.85%
This is ebtree commit c942a2771758eed4f4584fe23cf2914573817a6b.
|
||
|---|---|---|
| .. | ||
| atomic-ops.h | ||
| ceb32_tree.h | ||
| ceb64_tree.h | ||
| ceba_tree.h | ||
| cebb_tree.h | ||
| cebib_tree.h | ||
| cebis_tree.h | ||
| cebl_tree.h | ||
| cebs_tree.h | ||
| cebtree-prv.h | ||
| cebtree.h | ||
| eb32sctree.h | ||
| eb32tree.h | ||
| eb64tree.h | ||
| ebimtree.h | ||
| ebistree.h | ||
| ebmbtree.h | ||
| ebpttree.h | ||
| ebsttree.h | ||
| ebtree-t.h | ||
| ebtree.h | ||
| ist.h | ||
| lru.h | ||
| mjson.h | ||
| mt_list.h | ||
| plock.h | ||
| sha1.h | ||
| slz-tables.h | ||
| slz.h | ||
| xxhash.h | ||