• debing.sun's avatar
    Avoid overhead of comparision function pointer calls in lpFind() (#13503) · de7f2f87
    debing.sun authored
    
    
    In #13279 (found by @filipecosta90), for custom lookups, we introduce a
    comparison function for `lpFind()` to compare entry, but it also
    introduces some overhead.
    
    To avoid the overhead of function pointer calls:
    1. Extract the lpFindCb() method into a lpFindCbInternal() method that
    is easier to inline.
    2. Use unlikely to annotate the comparison method, as can only success
    once.
    
    ---------
    Co-authored-by: default avatarOzan Tezcan <ozantezcan@gmail.com>
    de7f2f87
listpack.c 113 KB