Skip to content

Reduce memoization TTL to 1 minute and cache cleanup interval to 30s#534

Merged
neSpecc merged 3 commits intomasterfrom
copilot/reduce-memoization-lifetime
Mar 6, 2026
Merged

Reduce memoization TTL to 1 minute and cache cleanup interval to 30s#534
neSpecc merged 3 commits intomasterfrom
copilot/reduce-memoization-lifetime

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Memoization lifetime was too long and cache cleanup ran too infrequently, increasing memory pressure and staleness window in the grouper worker.

Changes

  • MEMOIZATION_TTL: 600_000 ms → 60_000 ms (10 min → 1 min)
  • Cache cleanup interval: 5 minutes → 30 seconds — renamed constant to CACHE_CLEANUP_INTERVAL_SECONDS = 30, switched multiplier to TimeMs.SECOND
// Before
const MEMOIZATION_TTL = 600_000;
const CACHE_CLEANUP_INTERVAL_MINUTES = 5;
// ...
}, CACHE_CLEANUP_INTERVAL_MINUTES * TimeMs.MINUTE);

// After
const MEMOIZATION_TTL = 60_000;
const CACHE_CLEANUP_INTERVAL_SECONDS = 30;
// ...
}, CACHE_CLEANUP_INTERVAL_SECONDS * TimeMs.SECOND);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
Copilot AI changed the title [WIP] Decrease memoization lifetime and set cache cleanup interval Reduce memoization TTL by 50% and cache cleanup interval to 30s Mar 6, 2026
Copy link
Member

@neSpecc neSpecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot decrease MEMOIZATION_TTL to 1 minute

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 6, 2026

@copilot decrease MEMOIZATION_TTL to 1 minute

Done — MEMOIZATION_TTL is now 60_000 ms (1 minute) in commit 590749e.

Copilot AI changed the title Reduce memoization TTL by 50% and cache cleanup interval to 30s Reduce memoization TTL to 1 minute and cache cleanup interval to 30s Mar 6, 2026
@neSpecc neSpecc marked this pull request as ready for review March 6, 2026 17:45
@codex-assistant
Copy link

Thanks for adding a description — the PR is now marked as Ready for Review.

2 similar comments
@codex-assistant
Copy link

Thanks for adding a description — the PR is now marked as Ready for Review.

@codex-assistant
Copy link

Thanks for adding a description — the PR is now marked as Ready for Review.

@neSpecc neSpecc merged commit 360e31a into master Mar 6, 2026
7 checks passed
@neSpecc neSpecc deleted the copilot/reduce-memoization-lifetime branch March 6, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants