Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Consider mechanisms to manually invalidate cache, or to mark function as volatile #11

Open
bbarker opened this issue Aug 30, 2016 · 0 comments

Comments

@bbarker
Copy link

bbarker commented Aug 30, 2016

User story: I have a program that undergoes periods of simulation, then reporting on the simulation. During the simulation, I would like to mark some or maybe all @memoized functions as being "volatile", that is to say, not memoized. During reporting, the values returned from functions are not expected to change, so at that point they should be memoized.

A means to invalidate the cache (for some or all @memoized functions) could also be useful in some cases, but immediately going back to being cached would prove to be a problem for the above use case.

Another dimension of this is that sometimes, only values resulting from a specific argument pattern may need to be invalidated; if we invalidated everything from the function, this could greatly reduce performance in some cases. For instance, in the above user story, we may have multiple unique "simulation ids", and just because we run a new simulation, doesn't mean we need to recalculate all the data generated for the old simulation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant