diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js index 4304ab042c94..7d49355a402f 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js @@ -18,6 +18,61 @@ import * as React from 'react'; let root; let thousandViews: React.MixedElement; +function createViewsWithLargeAmountOfPropsAndStyles(count: number): React.Node { + let views: React.Node = null; + for (let i = 0; i < count; i++) { + views = ( + + {views} + + ); + } + return views; +} Fantom.unstable_benchmark .suite('View') @@ -80,4 +135,58 @@ Fantom.unstable_benchmark root.destroy(); }, }, + ) + .test( + 'render 100 views with large amount of props and styles', + () => { + Fantom.runTask(() => root.render(thousandViews)); + }, + { + beforeAll: () => { + // $FlowExpectedError[incompatible-type] + thousandViews = createViewsWithLargeAmountOfPropsAndStyles(100); + }, + beforeEach: () => { + root = Fantom.createRoot(); + }, + afterEach: () => { + root.destroy(); + }, + }, + ) + .test( + 'render 1000 views with large amount of props and styles', + () => { + Fantom.runTask(() => root.render(thousandViews)); + }, + { + beforeAll: () => { + // $FlowExpectedError[incompatible-type] + thousandViews = createViewsWithLargeAmountOfPropsAndStyles(1000); + }, + beforeEach: () => { + root = Fantom.createRoot(); + }, + afterEach: () => { + root.destroy(); + }, + }, + ) + .test( + 'render 1500 views with large amount of props and styles', + () => { + Fantom.runTask(() => root.render(thousandViews)); + }, + { + beforeAll: () => { + // $FlowExpectedError[incompatible-type] + thousandViews = createViewsWithLargeAmountOfPropsAndStyles(1500); + }, + beforeEach: () => { + root = Fantom.createRoot(); + }, + afterEach: () => { + root.destroy(); + }, + }, );