Writing high-performance programs is usually a mixture of using good algorithms and the smart usage of computer processing power. Caching is one mechanism that can help us, especially when a method takes time to calculate or it's called a lot of times in our application.
Memoization is a mechanism of recording a function result based on its arguments in order to reduce computation in consecutive calls.
Along with saving CPU cycles, memoization can also be useful to minimize the application memory footprint by only having one instance of each result. Of course, for this entire mechanism to work, we need to have a function that always returns the same result when the same arguments are passed.