-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a function Evaluator class with policy based caching capabilities #5253
Conversation
95dab0c
to
b986936
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs more documentation in certain places. I didn't notice any defects overall. The tests, however, and not table-driven and thus not as extensive as this code deserves.
9733e59
to
2c93955
Compare
a823c9c
to
8d48d60
Compare
8d48d60
to
94c7ac9
Compare
Note: |
#5215 for context and previous reviews.
This work evolved into something a bit more generic than the tile offsets transparent cache we originally intended to write.
This PR adds:
Evaluator
classImmediateEvaluation
policyConfigures the evaluator to execute
cb(key)
for any invocation ofeval(key)
.MaxEntriesCache
policyConfigures the evaluator to execute
cb(key)
and cache the results in a LRU cachethat cannot hold more than
N
values. Caching valueN+1
triggers cache eviction.Evaluator<MaxEntriesCache<Key, Value, N>, Callback> eval(cb);
MemoryBudgetedCache
policyConfigures the evaluator to execute
cb(key)
and cache the results in a LRU cachewith a capacity of
M
bytes whereM
is passed during the evaluator construction.[sc-51496]
TYPE: FEATURE
DESC: Add a function Evaluator class with policy based caching capabilities