Skip to content
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

fix: DH-18798 - token cache growing unbounded #2374

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

mattrunyon
Copy link
Collaborator

@mattrunyon mattrunyon commented Feb 27, 2025

This adds a cache for the token cache. I tested this was actually causing the issue by adding some code to the cell renderer to prefill the cache to 1 million items. It hung around 200k without the max. With max it prefills just fine (cleaning out every 10k) and doesn't hinder performance.

@mattrunyon mattrunyon requested review from a team and Copilot February 27, 2025 00:34
@mattrunyon mattrunyon self-assigned this Feb 27, 2025
@mattrunyon mattrunyon requested review from dgodinez-dh and removed request for a team February 27, 2025 00:34
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.80%. Comparing base (b1787c8) to head (1bfdd13).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2374   +/-   ##
=======================================
  Coverage   46.80%   46.80%           
=======================================
  Files         710      710           
  Lines       39226    39226           
  Branches     9975     9975           
=======================================
  Hits        18358    18358           
  Misses      20814    20814           
  Partials       54       54           
Flag Coverage Δ
unit 46.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Choose a reason for hiding this comment

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

PR Overview

This PR addresses the issue of an unbounded token cache by introducing a maximum limit in the token processing function within the grid model.

  • Adds an options parameter with a max limit to the call of GridUtils.findTokensWithProtocolInText.
  • Updates the GridModel.ts file accordingly.

Reviewed Changes

File Description
packages/grid/src/GridModel.ts Adds an options object with a max limit to control token caching

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/grid/src/GridModel.ts:232

  • Confirm that adding an options object as a second argument to GridUtils.findTokensWithProtocolInText aligns with its expected function signature. This change is critical to ensure that the caching behavior is properly controlled.
},
@mattrunyon mattrunyon merged commit 3f74d44 into deephaven:main Feb 27, 2025
12 checks passed
@mattrunyon mattrunyon deleted the DH-18798_token-cache-fix branch February 27, 2025 16:11
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants