The memoization pattern
In 1968, an interesting article was published—it envisioned that computers should be able to learn from experience during execution and improve their own efficiency.
In developing software, we often face a situation where the speed of execution is constrained by many factors. Maybe a function needs to read a large amount of historical data from disk (also known as I/O-bound). Or a function just needs to perform some complex calculation that takes a lot of time (also known as CPU-bound). When these functions are called repeatedly, application performance can suffer greatly.
Memoization is a powerful concept to address these problems. In recent years, it has become more popular as functional programming is becoming ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access