I have some values I want to cache which are very expensive to generate in terms of processing, and some that are comparatively cheaper but have a bigger size in bytes.
As I understand it I can input the cost of generating each item in the Set() method to prioritize keeping expensive items in the cache. However I also want to limit the size of the cache to about 100MB, so if I use the time complexity as the cost value, the MaxCost parameter doesn’t limit the space taken up by the cache.
Is there or will there be a concept of “worth” vs “storage cost”? Let’s say some values are expensive but tiny, and others are cheap to generate but take up a lot of space. The small values should almost never be evicted, and almost always be admitted into the cache. Can these two concepts be captured in Ristretto? As I understand it I would want to specify the storage cost of a value separately from the cost of generating the value, and have a separate parameter for the max memory footprint, separate from the current MaxCost parameter?