• Brennan's avatar
    Prevent repetitive backlog trimming (#12155) · 40e6131b
    Brennan authored
    When `replicationFeedSlaves()` serializes a command, it repeatedly calls
    `feedReplicationBuffer()` to feed it to the replication backlog piece by piece.
    It is unnecessary to call `incrementalTrimReplicationBacklog()` for every small
    amount of data added with `feedReplicationBuffer()` as the chance of the conditions
    being met for trimming are very low and these frequent calls add up to a notable
    performance cost. Instead, we will only attempt trimming when a new block is added
    to the replication backlog.
    
    Using redis-benchmark to saturate a local redis server indicated a performance
    improvement of around 3-3.5% for 100 byte SET commands with this change.
    40e6131b
replication.c 170 KB