Skip to content

Is LRU the right eviction policy? #499

Closed

Description

@recmo

If the build size is larger than the cache size the LRU policy results in many misses: the targets about to be rebuild are the oldest ones, and therefore most likely to be evicted.

Activity

  1. luser commented on Aug 26, 2019

    @luser
    Contributor

    If the build size is larger than the cache size then I don't think any eviction policy is going to result in a good time.

  2. recmo commented on Aug 26, 2019

    @recmo
    Author

    In this scenario (aka sequential scan) LRU is the worst strategy, with zero hits. A trivial strategy that performs better is random replacement: just evict a random item. Another imho interesting class are strategies that count the number of hits (least frequently used, etc).

  3. froydnj commented on Aug 26, 2019

    @froydnj
    Contributor

    My understanding is that sccache is designed with the intention that you can adjust your cache to easily be at least integer factors larger than your build, if not orders of magnitude larger. Any situation where your cache can't be that large is not really interesting to sccache.

    LRU can still be pathologically bad, of course, but I don't think we're interested in exploring alternative cache eviction policies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions