Skip to content

Commit

Permalink
fix: DH-18798 - token cache growing unbounded (#2374)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattrunyon committed Feb 27, 2025
1 parent cd60519 commit 08de594
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/grid/src/GridModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ abstract class GridModel<
const contentToCheckForLinks = text.substring(0, lengthOfContent);

return GridUtils.findTokensWithProtocolInText(contentToCheckForLinks);
}
},
{ max: 10000 }
);

renderTypeForCell(column: ModelIndex, row: ModelIndex): CellRenderType {
Expand Down

0 comments on commit 08de594

Please sign in to comment.