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
This commit is contained in:
Michel Weststrate
2021-03-23 12:54:16 -07:00
committed by Facebook GitHub Bot
parent ba8232f30d
commit c7c75a082f

View File

@@ -32,7 +32,7 @@ function generateTodos(amount: number): Todo[] {
const defaultFilter = (t: Todo) => !t.done; const defaultFilter = (t: Todo) => !t.done;
type DataSourceish = DataSource<Todo> & FakeDataSource<Todo>; type DataSourceish = DataSource<Todo> | FakeDataSource<Todo>;
// NOTE: this run in jest, which is not optimal for perf, but should give some idea // 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 // 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 measurements: any = {};
const smallSize = 100000; const smallSize = 50000;
const largeSize = 200000; const largeSize = 100000;
const smallset = generateTodos(smallSize); const smallset = generateTodos(smallSize);
const largeset = generateTodos(largeSize); const largeset = generateTodos(largeSize);
@@ -202,7 +202,7 @@ class FakeDataSource<T> {
(this.data as any)[index] = v; (this.data as any)[index] = v;
} }
remove(index: number) { delete(index: number) {
this.data = this.data.slice(); this.data = this.data.slice();
(this.data as any).splice(index, 1); (this.data as any).splice(index, 1);
} }