January 2020
Intermediate to advanced
532 pages
13h 31m
English
Memoization can only be applied to pure functions.
What is a pure function? A function is called pure when it always returns the same value given the same input. It may seem intuitive for every function to behave that way but in practice, it is not that straightforward. Some functions are not pure due to reasons such as these:
Because the memoization pattern uses function arguments as the key of the in-memory cache, it will always return the same result for the same key.
Another consideration is that we should be aware of the extra memory overhead ...
Read now
Unlock full access