• judeng's avatar
    postpone the initialization of oject's lru&lfu until it is added to the db as... · d71478a8
    judeng authored
    postpone the initialization of oject's lru&lfu until it is added to the db as a value object (#11626)
    
    This pr can get two performance benefits:
    1. Stop redundant initialization when most robj objects are created
    2. LRU_CLOCK will no longer be called in io threads, so we can avoid the `atomicGet`
    
    Another code optimization:
    deleted the redundant judgment in dbSetValue, no matter in LFU or LRU, the lru field inold
    robj is always the freshest (it is always updated in lookupkey), so we don't need to judge if in LFU
    d71478a8
server.c 287 KB