Memoization
Memoization is an optimization technique that stores computation results with their inputs so equivalent later evaluations can reuse them without recomputation.
Fabulous Adventures in Data Structures and Algorithms
A memoized function is a function wrapper that returns cached results for inputs previously evaluated by the original function.
- How it is used
- Uses cached results to deduplicate immutable quadtrees and avoid repeating Life-state calculations.
- How deep it goes
- Implements a one-argument C# memoizer, applies it to factories and stepping, and measures cache costs.
- Examples
- Demonstrates a dictionary-backed C# wrapper, memoized quadtree constructors, and measured Life cache hits.
- What you can do after
- Build it from scratch with a C# dictionary wrapper, then evaluate whether repeated calls justify its cache.
Read how Fabulous Adventures in Data Structures and Algorithms explains memoization →
React in Depth
Memoization is a technique that caches a computation or component result so it can be reused when relevant inputs have not changed.
- How it is used
- Uses memoization to reduce unnecessary React rendering and repeated calculations during state updates.
- How deep it goes
- Works through component, JSX, value, and callback memoization, including dependency behavior and prop identity; does not develop a general caching implementation.
- Examples
- Compares to-do list renders, filters employees, and restructures a TypeScript playlist around memoized song components.
- What you can do after
- Apply it via React `memo()`, `useMemo()`, and `useCallback()` to preserve unchanged component output, derived values, and function props.
Functional Programming in JavaScript
A technique that caches the results of function calls so repeated calls with the same inputs can reuse prior results instead of recomputing.
- How it is used
- Uses function-level caching to optimize expensive functional JavaScript computations without scattering explicit cache management through application code.
- How deep it goes
- Explains argument-based cache keys, cache hits and misses, JavaScript wrapping, and recursive reuse, but not cache invalidation.
- Examples
- Demonstrates cached student lookup, ROT13 encoding, recursive factorial, and a composed student-search pipeline.
- What you can do after
- Build it from scratch in JavaScript with a memoize wrapper and apply it to expensive, repeatable function calls.
Read how Functional Programming in JavaScript explains memoization →
Latency
Memoization is a technique that caches the results of computations so repeated calls with the same inputs can return stored results.
- How it is used
- Reduces repeated computation in recursive functions and latency when clients reuse REST API results.
- How deep it goes
- Defines input-keyed caching and walks through a Rust implementation and benchmark; treats API freshness through TTL trade-offs.
- Examples
- Compares recursive, memoized, and iterative Fibonacci implementations using Criterion timings, and cites client-side REST API caching.
- What you can do after
- Build it from scratch with an input-keyed cache and evaluate its benefit against recursion and iteration using Criterion.
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
Memoization is an optimization technique that caches the results of computations so repeated requests for the same inputs can be answered without recomputation.
- How it is used
- Uses cached results to avoid repeated computation in recursive algorithms and repeated real-world calculations.
- How deep it goes
- Defines the technique, implements it with a Swift dictionary, measures Fibonacci’s improvement, and contrasts it with iteration.
- Examples
- Uses recursive Fibonacci, a Swift Dictionary memo table, parser work, and automatic memoization in Prolog runtimes.
- What you can do after
- Apply it via a Swift Dictionary to cache recursive results and diagnose redundant calls in Fibonacci-like computations.
Clojure: The Essential Reference
Memoization is a caching technique that stores the results of function evaluations keyed by their inputs.
- How it is used
- Speeds repeated non-trivial computations by caching results under their argument values.
- How deep it goes
- Defines the function contract, demonstrates cache hits, and instruments calls, hits, misses, and estimated memory.
- Examples
- Uses memoized addition, Levenshtein distance, dictionary filtering, spelling suggestions, and cache statistics.
- What you can do after
- Apply it via Clojure's memoize to eliminate repeated computation and inspect behavior with a custom instrumented wrapper.
Read how Clojure: The Essential Reference explains memoization →
Advanced Algorithms and Data Structures
Memoization is a technique that caches the results of computations so repeated calls with the same inputs can reuse them.
- How it is used
- Reduces duplicate work in recursive graph algorithms by caching results for smaller subproblems.
- How deep it goes
- Explains cache lookup and storage in recursive planarity testing, but stops short of a general implementation survey.
- Examples
- Uses repeated graph calls, duplicate subgraphs, and a cached planarity-testing listing.
- What you can do after
- Build it from scratch by adding cache lookup and result storage to a recursive graph algorithm.
Read how Advanced Algorithms and Data Structures explains memoization →
Secrets of the JavaScript Ninja, Second Edition
A technique that stores computed results so repeated calls with the same inputs can reuse them.
- How it is used
- Uses function properties to cache results and avoid repeating expensive calculations.
- How deep it goes
- Explains cache initialization, lookup, and storage through a single prime-checking function.
- Examples
- Uses prime testing and names animation calculations, stable-data searches, and time-consuming math as use cases.
- What you can do after
- Apply memoization in JavaScript by caching results on a function and reusing them for repeated inputs.
Read how Secrets of the JavaScript Ninja, Second Edition explains memoization →
Related concepts
- useCallbackused by · useCallback is a React Hook that memoizes a function reference and reuses it across renders until its specified dependencies change.
- useMemoused by · useMemo is a React Hook that caches a calculated value between renders and recomputes it when specified dependencies change.
- dynamic programmingused by · Dynamic programming is an algorithmic technique that solves problems by decomposing them into overlapping subproblems and storing or reusing their solutions.
- cachinguses · Caching is the practice of storing reusable data or computation results so subsequent access can avoid repeating the original retrieval or computation.
- functionproduces · A function is a defined operation that maps inputs to outputs and, when implemented as a callable program unit, may also produce effects.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







