-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Evict #11
Comments
I think that makes sense. That will support a more efficient implementation because we will know statically what is the next entry to evict based on time to live and when to evict it versus having to potentially traverse the entire cache to see if items need to be evicted (assuming they aren't accessed and evicted then). |
The cache can remain as flexible as it is (Priority-based eviction for clearing space when needed) and also support TTL-based expiration efficiently. In order to accomplish this, I believe there are a couple of changes that would need to be made (inline with this story and #6 )
Overview of Potential Cache StrategyThere are two questions we need to answer for caching, taking into account the user-defined priorities:
(1) Can be used to implement a ticker in a daemon fiber that evicts expired cache entries In order two support both operations efficiently, the cache needs to be composed of three data structures:
|
CachePolicy
EntryStats
Cache#make
)Separately, move "ttl" concerns as
expirationTime
member ofEntryStats
(#6 alternative idea).The text was updated successfully, but these errors were encountered: