Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Real LRU eviction algorithm #1459
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
This is very interesting, thanks! In the past this was never attempted for the fear of the additional memory usage, however there is to evaluate the cost with care and check if there are fields we could remove from the object structure to make room... checking what allocation class of jemalloc to target, and so forth.
Also I would love to write a simulation to check the real advantage of this feature over the imprecise sampling we do. The simulation should just write keys on a Redis instance configured with a given maxmemory setting. We could write the application so that it remembers what are the recently used objects, and verify what is inside the database. Your implementation should score 100% (100% of objects inside the database are the ones with the smallest access time), while the current implementation should not score so well.
I think it is an important step to actually measure what we gain exactly. Great contribution btw! Thanks again.