One of my favorite light-weight memoization strategy is to just remember the result of the last call. Basically
function foo(a,b,c)
if (a,b,c) === foo_last_args
return foo_last_return_value
else
... compute and store
end
end
It solves the problem of the ever-growing dictionary, since only one value is stored. Are you interested in an implementation for this package?
One of my favorite light-weight memoization strategy is to just remember the result of the last call. Basically
It solves the problem of the ever-growing dictionary, since only one value is stored. Are you interested in an implementation for this package?