Repository navigation
[feature] Add optional maxsize to MemoryCacheEvaluator - #304
Merged
Merged
Conversation
MemoryCacheEvaluator keeps every result for the life of the evaluator, which is costly when results are large. The new maxsize field bounds the cache: hits refresh an entry, and storing a new result evicts the least recently used entries beyond maxsize. The default of None keeps the cache unbounded. Results and ids are now stored after evaluation succeeds, so a failed call no longer leaves an entry in ids. Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>
Contributor
Test Results 1 files ±0 1 suites ±0 2m 49s ⏱️ -32s Results for commit eae81ba. ± Comparison against base commit f43013d. This pull request skips 1 and un-skips 4 tests.♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
==========================================
+ Coverage 93.63% 93.67% +0.04%
==========================================
Files 205 205
Lines 23158 23395 +237
Branches 1519 1541 +22
==========================================
+ Hits 21683 21916 +233
- Misses 1181 1185 +4
Partials 294 294 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ptomecek
marked this pull request as ready for review
December 1, 2026 13:06
hintse
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MemoryCacheEvaluatorkeeps every result for the life of the evaluator. That is costly when a model returns something large, such as a dataframe built once and read by a few downstream models, and ccflow has no cache scoped to part of a run.This adds an optional
maxsizefield. When set, the cache keeps at mostmaxsizeresults: a cache hit refreshes the entry, and storing a new result evicts the least recently used ones. The default ofNonekeeps today's unbounded behaviour. Models that should share a bounded cache use the same evaluator instance, as before.Because
maxsizeis a public field, it is part of the evaluator's token. The default evaluator's cache keys are unchanged. One small behaviour change: results and ids are now stored after evaluation succeeds, so a failed call no longer leaves an entry inids.Type of Change
Checklist
make lint)make test); the only local failures are thetest_lerna_*tests, which fail onmainin the same environment