From c7c75a082fd796c3a7f23da8ab9034a4a8e8410c Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 23 Mar 2021 12:54:16 -0700 Subject: [PATCH] Fix failing perf test Summary: made a typescript booboo, and broke the test thereby. Also reduced the test set to avoid OOMs Reviewed By: passy Differential Revision: D27261187 fbshipit-source-id: bcb61bf95419421d9c33e7e0a944717797f96dfe --- .../src/state/__tests__/datasource-perf.node.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/flipper-plugin/src/state/__tests__/datasource-perf.node.tsx b/desktop/flipper-plugin/src/state/__tests__/datasource-perf.node.tsx index e2053b69f..ffd658ff4 100644 --- a/desktop/flipper-plugin/src/state/__tests__/datasource-perf.node.tsx +++ b/desktop/flipper-plugin/src/state/__tests__/datasource-perf.node.tsx @@ -32,7 +32,7 @@ function generateTodos(amount: number): Todo[] { const defaultFilter = (t: Todo) => !t.done; -type DataSourceish = DataSource & FakeDataSource; +type DataSourceish = DataSource | FakeDataSource; // NOTE: this run in jest, which is not optimal for perf, but should give some idea // make sure to use the `yarn watch` script in desktop root, so that the garbage collector is exposed @@ -48,8 +48,8 @@ test.skip('run perf test', () => { const measurements: any = {}; - const smallSize = 100000; - const largeSize = 200000; + const smallSize = 50000; + const largeSize = 100000; const smallset = generateTodos(smallSize); const largeset = generateTodos(largeSize); @@ -202,7 +202,7 @@ class FakeDataSource { (this.data as any)[index] = v; } - remove(index: number) { + delete(index: number) { this.data = this.data.slice(); (this.data as any).splice(index, 1); }