Skip to content
Snippets Groups Projects

Add variable-entry-size LRU cache implementation in internal/memcache

Closed Warren Gifford requested to merge ef/internal-memcache into master

Created by: efritz

Add internal/memcache, a variation of github.com/hashicorp/golang-lru that allows cache values to report their size. This allows an in-memory cache to be gauged on its memory pressure rather than assuming that all cache values are equally weighted.

This will be necessary to store variable-length documents in the precise-code-intel-bundle-manager, which is being rewritten in Go (effort tracked in https://github.com/sourcegraph/sourcegraph/issues/9964).

This PR is being submitted separately to get more in-depth reviews on the cache implementation (which could be used easily in other parts of the code base) without getting overshadowed by larger changed in the porting effort.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading