awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·

Memoization constraints

Ranking updated Jul 29, 2026

For memoization constraints, the strongest matches are hashicorp/golang-lru (This thread-safe Go library provides an in-memory cache featuring), coocood/freecache (Freecache provides concurrent in-memory caching with a fixed size) and isaacs/node-lru-cache (This JavaScript caching utility provides memory limits, time-to-live expiration). dgraph-io/ristretto and pmylund/go-cache round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.

Hand-picked memoization libraries for managing function cache limits, compared by features and GitHub stars to find the best fit.

Memoization constraints

Find the best repos with AI.We'll search the best matching repositories with AI.
  • hashicorp/golang-lruhashicorp avatar

    hashicorp/golang-lru

    5,091View on GitHub↗

    This is a thread-safe in-memory cache library for Go that automatically evicts the least recently used items when capacity is reached. It provides a fixed-size memory cache designed to maintain a constant memory footprint by removing the oldest entries as new data arrives. The system includes an eviction manager that executes custom callbacks when entries are purged to facilitate resource cleanup. It also supports time-based expiration, allowing for the automatic removal of items after a specified time-to-live duration. The library covers general caching capabilities including cache inspecti

    This thread-safe Go library provides an in-memory cache featuring fixed capacity limits and time-to-live expiration policies, directly matching your need for a constrained memoization utility.

    GoTime-Based ExpirationsTime-To-Live ExpirationsMemory Eviction Policies
    View on GitHub↗5,091
  • coocood/freecachecoocood avatar

    coocood/freecache

    5,399View on GitHub↗

    freecache is a high-performance, concurrent in-memory key-value store library for Go applications. It functions as a fixed-size cache that manages large volumes of data while eliminating garbage collection overhead through the use of preallocated memory and off-heap storage. The system maintains a predictable memory footprint by utilizing fixed memory allocation and circular buffer management, where new entries automatically overwrite the oldest data upon reaching capacity. It further reduces contention between simultaneous readers and writers through lock-striped concurrent access. The libr

    Freecache provides concurrent in-memory caching with a fixed size limit and eviction policies, though it is designed as a key-value store rather than a dedicated function memoization utility.

    GoCache Eviction PoliciesTime-To-Live ExpirationsTTL Expiration Management
    View on GitHub↗5,399
  • isaacs/node-lru-cacheisaacs avatar

    isaacs/node-lru-cache

    5,895View on GitHub↗

    node-lru-cache is a key-value store for Node.js that implements a memory-limited cache. It prevents memory exhaustion by capping the total number of items or total byte size, automatically evicting the least-recently-used items to maintain these limits. The project provides specialized caching patterns, including time-to-live durations to ensure data freshness and a stale-while-revalidate mechanism that serves expired content while asynchronously fetching updates in the background. It also includes diagnostic tools for monitoring cache hits, misses, and eviction metrics through operational st

    This JavaScript caching utility provides memory limits, time-to-live expiration, and eviction policies, though it functions as a general LRU cache store rather than a dedicated function memoization wrapper.

    JavaScriptCache Eviction PoliciesTime-To-Live Expirations
    View on GitHub↗5,895
  • dgraph-io/ristrettodgraph-io avatar

    dgraph-io/ristretto

    6,932View on GitHub↗

    Ristretto is a high-performance in-memory cache and concurrent key-value store for Go applications. It provides a thread-safe memory store that manages strict memory bounds and employs probabilistic set filters to reduce lookup overhead. The system is distinguished by an admission-policy cache that utilizes frequency sketches and cost-based eviction to maximize hit ratios. It minimizes contention and improves throughput through the use of striped ring buffers and concurrent map sharding. The project covers a broad range of data management capabilities, including time-based expiration, item f

    Ristretto is an in-memory caching library for Go that provides time-to-live expiration, strict memory bounds, and thread safety, though it lacks built-in weak references and async function support.

    GoCache Eviction PoliciesTime-To-Live Expirations
    View on GitHub↗6,932
  • pmylund/go-cachepmylund avatar

    pmylund/go-cache

    8,828View on GitHub↗

    go-cache is a thread-safe, in-memory key-value store for single-machine applications. It provides a local caching mechanism that stores objects in RAM to reduce redundant data retrieval and avoid the overhead of network protocols or serialization. The system features a persistent cache store that saves the in-memory state to a local file, allowing data recovery across application restarts. The project manages concurrent data access across multiple routines and implements time-to-live expiration for cached entries. A background process periodically scans the store to delete expired items and

    It provides an in-memory caching utility with thread safety and time-to-live expiration, though it lacks some advanced features like weak references and explicit size eviction limits.

    GoTime-Based Expirations
    View on GitHub↗8,828
  • patrickmn/go-cachepatrickmn avatar

    patrickmn/go-cache

    8,828View on GitHub↗

    go-cache is a thread-safe, in-memory cache library for Go that stores arbitrary objects with per-item expiration timestamps. It provides a concurrent key-value store where multiple goroutines can safely read and write shared cached data without external synchronization, using a mutex-guarded map for access control. The library distinguishes itself through its expiration management and optional disk persistence. Each cached item carries its own time-to-live, and a background goroutine periodically purges expired entries. The cache can serialize its entire contents to disk using Go's gob encodi

    This thread-safe Go cache library provides in-memory storage with time-to-live expiration and concurrent access support, though it lacks features like size limits, weak references, and explicit async function wrappers.

    GoTime-To-Live Expirations
    View on GitHub↗8,828
  • ben-manes/caffeineben-manes avatar

    ben-manes/caffeine

    17,706View on GitHub↗

    Caffeine is a high-performance caching library for the Java virtual machine designed to manage object lifecycles within the application heap. It functions as a thread-safe, memory-resident data store that reduces latency by keeping frequently accessed objects available for immediate retrieval. The library distinguishes itself through a sophisticated eviction strategy that balances recency and frequency to determine which entries to retain. It utilizes a frequency-based admission policy to evaluate the historical access patterns of new data, ensuring that the cache remains populated with the m

    Caffeine is a high-performance Java caching library that provides thread safety, size limits, time-to-live expiration, custom keys, weak references, and async support, exactly matching your need for a constrained memoization and caching utility.

    JavaCaching LibrariesConcurrent CachesFrequency-Based Admission
    View on GitHub↗17,706
  • google/guavagoogle avatar

    google/guava

    51,473View on GitHub↗

    Guava is a Java standard library extension and utility toolkit that provides optimized data structures, concurrency tools, and core extensions. It serves as a comprehensive set of helpers for Java development, focusing on reducing repetitive boilerplate logic. The project is distinguished by its specialized implementations of immutable collections, which ensure thread safety and data consistency by preventing accidental modification. It also includes a dedicated graph data structure library for modeling and traversing networks of interconnected nodes and edges, alongside advanced collection t

    Guava provides robust in-memory caching utilities with features like size limits, time-based expiration, and concurrency support, making it a strong fit despite being a broader Java utility toolkit rather than a dedicated memoization library.

    JavaCache Eviction Policies
    View on GitHub↗51,473
  • grantjenks/python-diskcachegrantjenks avatar

    grantjenks/python-diskcache

    2,828View on GitHub↗

    This project is a disk-backed key-value store and persistent data structure library for Python. It provides a mechanism for persisting mappings, sets, and queues to the local filesystem to bypass memory limitations and cache expensive function results across threads and processes. The system serves as a cross-process synchronization tool, offering distributed locks, semaphores, and barriers to coordinate shared resource access. It implements advanced caching strategies such as probabilistic stampede prevention, sharded data partitioning to increase throughput, and least-recently-used eviction

    This disk-backed persistent cache library provides memoization and caching utilities with eviction policies and thread safety, though it focuses on disk storage rather than in-memory constraints.

    PythonCache Eviction Policies
    View on GitHub↗2,828
  • reactjs/reselectreactjs avatar

    reactjs/reselect

    19,033View on GitHub↗

    Reselect is a memoized selector framework and state selector library designed to optimize performance in Redux applications. It provides a system for computing derived data from a state store and caching the results to prevent unnecessary user interface re-renders. The library functions as a state transformation pipeline, allowing multiple selectors to be composed into chains. This enables the creation of complex data transformation pipelines where the output of one memoized selector serves as the input for another. The framework focuses on input-based memoization and referential equality ch

    Reselect is a state selector and memoized computation library designed for frontend applications, making it a well-suited utility for targeted memoization tasks even though it lacks comprehensive expiration and eviction policies.

    TypeScriptMemoized DerivationsComponent Update OptimizationsComposable Selector Pipelines
    View on GitHub↗19,033
  • alexreardon/memoize-onealexreardon avatar

    alexreardon/memoize-one

    2,971View on GitHub↗

    Memoize-one is a JavaScript function memoization library that stores function return values and serves them instantly on repeat calls with identical arguments to avoid redundant calculations. It retains only the single most recent argument set and return value, maintaining a constant and bounded memory footprint. The library features a shallow argument comparison engine and includes the runtime execution context alongside input arguments during comparison to ensure state and binding changes trigger fresh computations. Users can inject custom equality functions to override the default argumen

    Memoize-one is a JavaScript memoization library with a bounded single-result cache and custom equality support, though it lacks time-to-live expiration and asynchronous function handling.

    TypeScriptLast-Result CachesContext MemoizationCustom Comparison Logic
    View on GitHub↗2,971
  • caiogondim/fast-memoize.jscaiogondim avatar

    caiogondim/fast-memoize.js

    2,595View on GitHub↗

    Fast-memoize.js is a JavaScript memoization library that caches function return values for identical arguments to speed up expensive execution in JavaScript applications. It operates as a caching utility that stores and retrieves function outputs by serializing input parameters into unique keys. The library optimizes execution through arity-based function specialisation, generating tailored internal call paths based on the expected number of arguments. It features deterministic argument serialization to convert complex and variadic input parameters into unique string keys for reliable cache l

    Fast-memoize.js is a JavaScript memoization library that provides function result caching with custom serializer injections, though it lacks built-in time-to-live expiration and size limit policies out of the box.

    JavaScriptIn-Memory Function Caching UtilitiesFunction Result MemoizationMemoization Libraries
    View on GitHub↗2,595
  • reduxjs/reselectreduxjs avatar

    reduxjs/reselect

    19,032View on GitHub↗

    Reselect is a state management optimization tool and memoization utility designed to minimize redundant calculations and UI re-renders. It functions as a library for creating memoized selectors that derive specific data from a state store. The library implements input-based memoization and recursive selector composition to create a hierarchy of derived data dependencies. It ensures reference-stable result caching and provides custom equality checking to determine when a cache should be invalidated. The project covers capabilities for derived data computation, frontend performance optimizatio

    Reselect provides memoized selectors for derived state with custom equality checking and caching, though it is tailored for Redux rather than general-purpose caching with explicit eviction policies or TTL expiration.

    TypeScriptMemoization CachesComposable Selector PipelinesDerived State
    View on GitHub↗19,032
  • melpon/memoizemelpon avatar

    melpon/memoize

    204View on GitHub↗

    A method caching macro for elixir using CAS on ETS.

    This Elixir library provides method caching using ETS table operations, making it a solid utility for memoization despite lacking some of the advanced asynchronous and weak reference features.

    ElixirCaching
    View on GitHub↗204
  • sindresorhus/p-memoizesindresorhus avatar

    sindresorhus/p-memoize

    442View on GitHub↗

    Memoize promise-returning & async functions

    This library provides memoization specifically for promise-returning and asynchronous functions, fulfilling the core async requirement though it lacks built-in size limits and complex eviction policies.

    TypeScriptChain ManagementPromise Utilities
    View on GitHub↗442
  • nodeca/promise-memoizenodeca avatar

    nodeca/promise-memoize

    62View on GitHub↗

    Memoize promise-returning functions. Includes cache expire and prefetch.

    This JavaScript library memoizes promise-returning functions with expiration support, making it a fitting caching utility even though it lacks some advanced policies like size limits or weak references.

    JavaScriptControl Flow UtilitiesFlow Control
    View on GitHub↗62
  • tkem/cachetoolstkem avatar

    tkem/cachetools

    2,750View on GitHub↗

    Extensible memoizing collections and decorators

    This Python library provides extensible memoizing collections and decorators supporting size limits, expiration, and custom key generation, fitting the caching utility category well though lacking asynchronous function support.

    PythonCachingData Caching
    View on GitHub↗2,750
  • tornikegomareli/memoizemacrotornikegomareli avatar

    tornikegomareli/MemoizeMacro

    15View on GitHub↗

    A Swift macro for easy function memoization.

    This repository provides a Swift macro for function memoization, fitting the category as a language-specific utility even though it has a narrower feature set compared to a comprehensive caching library.

    SwiftUtility Macros
    View on GitHub↗15
  • jaemk/cachedjaemk avatar

    jaemk/cached

    2,040View on GitHub↗

    Rust cache structures and easy function memoization

    This Rust library provides cache structures and function memoization with explicit cache size limits and time-to-live expiration, fitting the requested caching utility category well despite lacking some advanced features like weak references or asynchronous support.

    RustCaching and MemoizationDatabases & Data
    View on GitHub↗2,040
  • sindresorhus/memsindresorhus avatar

    sindresorhus/mem

    1,157View on GitHub↗

    Memoize functions - an optimization technique used to speed up consecutive function calls by caching the result of calls with identical input

    This TypeScript utility memoizes function results to speed up consecutive calls, offering expiration and custom key generation, though it lacks built-in support for asynchronous functions and explicit size limits.

    TypeScriptFunctional ProgrammingGeneral Utilities
    View on GitHub↗1,157
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
hashicorp/golang-lru5.1KGoMPL-2.0May 25, 2026
coocood/freecache5.4KGoMITMar 19, 2026
isaacs/node-lru-cache5.9KJavaScriptBlueOak-1.0.0May 27, 2026
dgraph-io/ristretto6.9KGoApache-2.0May 6, 2026
pmylund/go-cache8.8KGoMITNov 20, 2023
patrickmn/go-cache8.8KGoMITNov 20, 2023
ben-manes/caffeine17.7KJavaApache-2.0Jun 16, 2026
google/guava51.5KJavaApache-2.0Jun 15, 2026
grantjenks/python-diskcache2.8KPythonotherAug 10, 2024
reactjs/reselect19KTypeScriptMITMay 18, 2026

Related searches

  • Type constraints
  • Concurrency control libraries
  • Data validation constraints
  • Mathematical optimization engine
  • a memory persistence layer for AI agents
  • Component caching
  • a library for parsing programming languages
  • Immutable data structures