News for hackers. Stuff that matters.
Re:Functional programming in C++ (2012) by MaulingMonkey on Monday December 28, 2020 @08:10PM (#25565433)
Permanent memoization is not your only option.

Caching the result of common inputs and discarding not-recently-used results can be useful on functions with huge - but nonuniformly distributed - input and output spaces. At the extreme, you might have procedural image or texture generation - perhaps the postprocessing of another image or texture, for example. Impurity is a great way to end up with serious cache invalidation bugs when untracked inputs are changed, and purity a great way to avoid them.

There are no comments on this comment yet.