You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which works as expected and seems functionally equivalent. Possibly related to #11 or shares in a misunderstanding on my part?
The text was updated successfully, but these errors were encountered:
russellpierce
changed the title
Created function with memoization causes partial cache miss
Created function with memoization causes partial cache miss with lapply
Nov 24, 2015
Thanks. I've got little time to look into this for the next couple weeks, but it's an important point. Just a quick reply for now:
I think this is the expected behavior with the current implementation of addMemoization(); it's simply not clever enough to identify the necessary globals that are part of promises when constructing the key for the memoization. It could probably be improved, particularly with help of the globals package. FYI, the dominant use of R.cache is through the explicit load/saveCache() mechanism (millions of CPU hours by now) and less so through the addMemoization() (which therefore has less real-world CPU mileage).
If we create a daughter function with a function and then memorize then we (sometimes?!) miss the cache on lapply.
Minimal Example:
Compare with
Which works as expected and seems functionally equivalent. Possibly related to #11 or shares in a misunderstanding on my part?
The text was updated successfully, but these errors were encountered: