• Oran Agra's avatar
    improve malloc efficiency for cluster slots_info_pairs (#10488) · 3b1e65a3
    Oran Agra authored
    This commit improve malloc efficiency of the slots_info_pairs mechanism in cluster.c
    by changing adlist into an array being realloced with greedy growth mechanism
    
    Recently the cluster tests are consistently failing when executed with ASAN in the CI.
    I tried to track down the commit that started it, and it appears to be #10293.
    Looking at the commit, i realize it didn't affect this test / flow, other than the
    replacement of the slots_info_pairs from sds to list.
    
    I concluded that what could be happening is that the slot range is very fragmented,
    and that results in many allocations.
    with sds, it results in one allocation and also, we have a greedy growth mechanism,
    but with adlist, we just have many many small allocations.
    this probably causes stress on ASAN, and causes it to be slow at termination.
    3b1e65a3
cluster.h 20.1 KB