memoize.lua is a library that takes a function as parameter and returns a "cached" version of that function. The first time the function is called with some parameters, it will act normally.

The second time it's called, however, it will "remember" the data result from previous computations, and will recover it from the cache instead of recalculating it.

memoizing is useful for functions that take lots of time to compute, and always return the same output with the same input. It's also useful for functions that read data from the disk.

Latest version :

See also