Skip to content

Commit 18b5f58

Browse files
authored
fix: DH-18798 - token cache growing unbounded (#2374) (#2377)
Cherry pick back to vplus 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.
1 parent cd60519 commit 18b5f58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/grid/src/GridModel.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ abstract class GridModel<
225225
const contentToCheckForLinks = text.substring(0, lengthOfContent);
226226

227227
return GridUtils.findTokensWithProtocolInText(contentToCheckForLinks);
228-
}
228+
},
229+
{ max: 10000 }
229230
);
230231

231232
renderTypeForCell(column: ModelIndex, row: ModelIndex): CellRenderType {

0 commit comments

Comments
 (0)