What Is Memoization?
Memoization is a programming technique that speeds up performance by caching the results of expensive function calls. When a function is memoized, it returns a precomputed value immediately if it has seen the same inputs before.
This article focuses on how to use memoization effectively rather than explaining how the technique works. It provides several examples to illustrate the proper use of memoization.
Whether or not to use memoization should be based on a careful performance analysis using appropriate tools.