Skip to content

Add an LRU to cache finds #359

@craigfe

Description

@craigfe

Following #355, we have some extra memory to play with w.r.t. caching the results of find operations (and it's also potentially more important that we do cache them, as all successful find operations must currently read from disk).

Here's some initial statistics on LRU cache hits achieved when running the replay benchmarks for Index:

$ dune exec bench/replay.exe ~/data/trace_544766125.repr -- --ops 100_000_000 

I interpret these results as saying:

  • it's relatively easy to get an LRU that performs well on this workload, needing only a capacity of ~3000 to cache nearly half the finds;
  • it's not worth pushing the capacity much higher than this, as sizes of the order log_size have marginal gains.

We can probably pick a default capacity of the order ~30,000 elements and get good results on most workloads. This is much less than the existing log size of 500,000, so we don't need to worry about the LRU taking up too much space.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions