memoize

bearophile bearophileHUGS at lycos.com
Tue Jan 4 11:29:39 PST 2011


Andrei:

> There is a difference between caching and memoization.

Yep, memoization is a special case of caching:
http://en.wikipedia.org/wiki/Memoization:
"Although related to caching, memoization refers to a specific case of this optimization,"


> I wouldn't want to burden the memoization implementation with LRU management.

My second proposal was a LRU, but the first simpler one wasn't. Even removing one random item when the cache memory is full (like the first inserted, so it's not a true LRU and you don't need double links) is better than clearing the clearing the whole memory as now.

Bye,
bearophile


More information about the Digitalmars-d mailing list