Memoization
Memoization is an optimization technique that stores results of computations with their inputs so later evaluations with equivalent inputs 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
- Uses memoization to eliminate repeated computation and reduce latency, including for client-side REST API results.
- How deep it goes
- Explains cache lookup and the space trade-off, then implements and benchmarks recursive Fibonacci with memoization.
- Examples
- Uses client-side REST API caching and a recursive Fibonacci calculation to illustrate reuse.
- What you can do after
- Builds it from scratch in a recursive Fibonacci implementation and measures its runtime against plain recursion.
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 →
Timeless Algorithms, The Foundational Ideas
Memoization is a dynamic-programming implementation technique that recursively evaluates only needed subproblems and caches their computed values.
- How it is used
- Implements dynamic programming top-down by recursively evaluating needed subproblems and retaining computed results for reuse.
- How deep it goes
- Explains memoization’s top-down role and optimization assumptions, without providing a worked memoization trace.
- Examples
- Uses multistage network optimization to illustrate recurrence-based decomposition and reuse of subproblem results.
- What you can do after
- Apply memoization to evaluate a recurrence exactly when optimal substructure holds, reusing results from overlapping subproblems.
Read how Timeless Algorithms, The Foundational Ideas explains memoization →
Also covered in
- AI Model EvaluationIn early access (MEAP)
- Secrets of the JavaScript Ninja, Third EditionIn early access (MEAP)
- Software Engineering for Data ScientistsIn early access (MEAP)
- Functional Programming in Scala, Second Edition
- React Hooks in Action: With Suspense and Concurrent Mode
- React Quickly, Second Edition
What to know first
- cachingCaching is the temporary storage of data or computed results for reuse, reducing the work or delay of retrieving or computing them again.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- performancePerformance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
- recursionRecursion is a computational technique in which a definition or procedure refers to or invokes itself, directly or indirectly.
Related concepts
- dynamic programmingused by · Dynamic programming is an algorithmic technique that solves problems by decomposing them into overlapping subproblems and storing or reusing their solutions.
- 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.
- tabulationalternative to · Tabulation is a dynamic-programming implementation technique that computes and stores subproblem results in an explicit order, typically from smaller to larger subproblems.
- cachinguses · Caching is the temporary storage of data or computed results for reuse, reducing the work or delay of retrieving or computing them again.
- functionproduces · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
Questions about memoization
What is memoization?
Memoization is an optimization technique that stores results of computations with their inputs so later evaluations with equivalent inputs can reuse them without recomputation.
Which Manning books explain memoization?
Fabulous Adventures in Data Structures and Algorithms, React in Depth, Functional Programming in JavaScript, Latency, Classic Computer Science Problems in Swift: Essential techniques for practicing programmers, Clojure: The Essential Reference, Advanced Algorithms and Data Structures, Secrets of the JavaScript Ninja, Second Edition and 1 more.
What should I know before learning memoization?
Manning books that teach memoization usually introduce caching, function, performance and recursion first.
What is the difference between memoization and tabulation?
Memoization is an optimization technique that stores results of computations with their inputs so later evaluations with equivalent inputs can reuse them without recomputation. Tabulation is a dynamic-programming implementation technique that computes and stores subproblem results in an explicit order, typically from smaller to larger subproblems.
What is memoization also called?
Memoization is also called memoize or memoizing.
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.








