Socket
Socket
Sign inDemoInstall

github.com/hashicorp/golang-lru

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/hashicorp/golang-lru

Package lru provides three different LRU caches of varying sophistication. Cache is a simple LRU cache. It is based on the LRU implementation in groupcache: https://github.com/golang/groupcache/tree/master/lru TwoQueueCache tracks frequently used and recently used entries separately. This avoids a burst of accesses from taking out frequently used entries, at the cost of about 2x computational overhead and some extra bookkeeping. ARCCache is an adaptive replacement cache. It tracks recent evictions as well as recent usage in both the frequent and recent caches. Its computational overhead is comparable to TwoQueueCache, but the memory overhead is linear with the size of the cache. ARC has been patented by IBM, so do not use it if that is problematic for your program. All caches in this package take locks while operating, and are therefore thread-safe for consumers.


Version published

Readme

Source

golang-lru

Please upgrade to github.com/hashicorp/golang-lru/v2 for all new code as v1 will not be updated anymore. The v2 version supports generics and is faster; old code can specify a specific tag, e.g. github.com/hashicorp/golang-lru/v1.0.2 for backwards compatibility.

FAQs

Last updated on 08 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc