Difference between revisions of "memoize.lua"
(Created page with "[http://love2d.org/forums/viewtopic.php?f=5&t=2867 Original forum thread ]. Latest version: https://github.com/kikito/memoize.lua memoize.lua is a library that takes a functio...") |
(cosmetic changes) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{#set:LOVE Version=Any}} | |
− | + | {{#set:Description=Generic memoization for Lua.}} | |
− | + | [[Category:Libraries]] | |
− | |||
− | |||
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. | 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. | ||
Line 10: | Line 8: | ||
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. | 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 : | ||
+ | |||
+ | * https://github.com/kikito/memoize.lua | ||
+ | |||
+ | ;See also | ||
+ | * [http://love2d.org/forums/viewtopic.php?f=5&t=2867 Original forum thread]. |
Latest revision as of 08:24, 27 April 2011
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