Memoization of complex calculations across runs / partial source code changes #1037
Replies: 5 comments
-
|
I.e., cache across partial source code edits |
Beta Was this translation helpful? Give feedback.
-
|
There are three approaches for memoization broadly. Any one of them is a sizable epic, plausible for
|
Beta Was this translation helpful? Give feedback.
-
|
Memoization needs both internal and external cache Importing "cached" would be feasible if one could work on it. However, I think that for memoization going out side for persistent storage, ending up accessing redis, etc is too much. Cons of external cache
Cons of internal cache
Overall I don't see a immediate solution that would work fast A quick in Rescript solution might be like this:
In fact a true solution should be a hybrid solution to maintain a good performace. Not one of the options.
Thus we need both the internal solution and bridging to sth like "cached" above. It is not internal or external. It has to be both. The problem is that only internal or only external cache will bring down the whole performance. It has to be a cascaded hybrid solution. |
Beta Was this translation helpful? Give feedback.
-
|
In ReducerProject, each source file is run separately, so a partial solution for this will be available by splitting the heavy parts which change less frequently into their own files. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, some context on a common use case:
So the useful thing here would be to make "key_intermediate_variable" cached - then could rapidly iterate on the light calculations in file2 (would be basically instant), rather than waiting ~30sec each time for "key_intermediate_variable" to be recomputed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a pattern that comes up in a project I'm working on
The heavy model for complex_variable will only change every once in a while. At the same time, it would be nice to be able to iterate interactively with simpleComputation (eg, try with a bunch of diff input params iteratively, without having to rerun complex variable every time).
So in addition to just memoizing/caching for a given run of squiggle, could be very useful to cache across runs. (Or even, at least in this case, caching across runs would be more useful.)
Beta Was this translation helpful? Give feedback.
All reactions