memoization (or memoisation) is a technique from computer programming to optimize a computer program. computer programs call functions. each function calculates a result it will return. memoization is simple: before the value is returned from the function call, it is stored in a table (or associative array). like a cache, this array will only be able to store a limited number of results. the function can then be changed so it tries to look up the value of the input in its lookup table. this lookup is much less expensive than doing the calculation again. also like a cache: the data table will be cleaned periodically, for examples the values that have not been lookued up for a given time are removed.