Difference between revisions of "memoize.lua"

(cosmetic changes)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{#set:LOVE Version=any}}
+
{{#set:LOVE Version=Any}}
 
{{#set:Description=Generic memoization for Lua.}}
 
{{#set:Description=Generic memoization for Lua.}}
 
 
[[Category:Libraries]]
 
[[Category:Libraries]]
  
[http://love2d.org/forums/viewtopic.php?f=5&t=2867 Original forum thread ].
+
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.
  
Latest version:
+
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.
  
https://github.com/kikito/memoize.lua
+
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.
  
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.
+
Latest version :
  
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.
+
* https://github.com/kikito/memoize.lua
  
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.
+
;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