fix(apollo-forest-run): fix perf regression from new auto-eviction#657
Merged
fix(apollo-forest-run): fix perf regression from new auto-eviction#657
Conversation
📊 Benchmark Analysis Report🔍 Found 2 significant change(s) 🎯 Same Configuration ComparisonsComparing against baseline with the same cache configuration
Threshold: 5% change Updated: 2026-04-09T11:25:18.380Z |
joeflateau
reviewed
Mar 27, 2026
Comment on lines
-170
to
+130
| // Process each partition | ||
| for (const { | ||
| options: partitionConf, | ||
| operations: evictableOperationIds, | ||
| } of partitionsOps.values()) { | ||
| // During auto-eviction, respect per-partition autoEvict settings | ||
| if (isAutoEvict) { | ||
| if (!partitionConf.autoEvict) { | ||
| continue; | ||
| } | ||
| } | ||
| const maxCount = partitionConfig.maxOperationCount; |
Contributor
There was a problem hiding this comment.
I think we may need to restore the
if (isAutoEvict && !partitionConfig.autoEvict) { continue; }
check here.
if partition A { autoEvict: false } is over maxOpCount and partition B { autoEvict: true } is written to and also over maxOpCount * 2 this would cause partition A to auto evict
Contributor
Author
There was a problem hiding this comment.
See 7c2a6ef, also added a test for this case
…viction evictOldData now respects per-partition autoEvict flag when triggered automatically Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
joeflateau
approved these changes
Apr 9, 2026
pavelglac
approved these changes
Apr 9, 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.
Overview
A follow up for #653 Fixes a minor perf regression by changing how operations per partition are tracked.
Details
With #653 every write was leading to auto-eviction attempt. And the "size" of every partition had to be calculated every time "lazily" because partition was not "assigned" to a tree until eviction time.
With this PR partition is assigned when the tree is added to the forest. This way we can skip auto eviction if partition is not big enough yet.
Current threshold: auto-eviction kicks-in when partition grows 2x of the configured partition size. After eviction it shrinks to 1x and doesn't try to auto-evict until it reaches 2*x again.