Skip to content

Commit aa9083d

Browse files
committed
Add ReportActionsUtilsCache perf test warmup runs
1 parent 9005d27 commit aa9083d

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

tests/perf-test/ReportActionsUtilsCache.perf-test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,26 @@ describe('ReportActionsUtils Cache Performance', () => {
2828

2929
const actionsArray = Object.values(reportActions);
3030

31-
getSortedReportActions(actionsArray, true);
32-
33-
await measureFunction(() => getSortedReportActions(actionsArray, true), {runs: 20});
31+
await measureFunction(() => getSortedReportActions(actionsArray, true), {
32+
runs: 20,
33+
warmupRuns: 5,
34+
});
3435
});
3536

36-
test('[ReportActionsUtils] getSortedReportActions with different array references', async () => {
37+
test('[ReportActionsUtils] getSortedReportActions cache hit with different array references', async () => {
3738
const reportActions = createCollection<ReportAction>(
3839
(item) => `${item.reportActionID}`,
3940
(index) => createRandomReportAction(index),
4041
ACTIONS_COUNT,
4142
);
4243

4344
const actionsArray = Object.values(reportActions);
44-
45-
getSortedReportActions(actionsArray, true);
46-
4745
const newArrayRef = [...actionsArray];
4846

49-
await measureFunction(() => getSortedReportActions(newArrayRef, true), {runs: 20});
47+
await measureFunction(() => getSortedReportActions(newArrayRef, true), {
48+
runs: 20,
49+
warmupRuns: 5,
50+
});
5051
});
5152
});
53+

0 commit comments

Comments
 (0)