Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
byorgey
· 3y ago · 0 comments
It keeps the table in memory while the function is in scope.
Comments
[–]
tsimionescu
3y ago
I assume this could be fixed by using a lambda instead of a top level function if you only want to occasionally call such a function, and don't need the whole memoization table around all the time?
[–]
consilient
3y ago
Yes, although you need to make sure it doesn't get optimized away.