mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-05-07 10:33:08 +08:00
25 lines
753 B
JavaScript
25 lines
753 B
JavaScript
import benchmark from '../../benchmark';
|
|
import createDeepTree from './createDeepTree';
|
|
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import ReactNative from 'react-native';
|
|
|
|
// React Native for Web implementation of the tree
|
|
const DeepTree = createDeepTree(ReactNative);
|
|
|
|
const deepTreeBenchmark = ({ breadth, depth, wrap, runs }, node) => () => {
|
|
const setup = () => { };
|
|
const teardown = () => ReactDOM.unmountComponentAtNode(node);
|
|
|
|
return benchmark({
|
|
name: 'DeepTree',
|
|
description: `depth=${depth}, breadth=${breadth}, wrap=${wrap})`,
|
|
runs,
|
|
setup,
|
|
teardown,
|
|
task: () => ReactDOM.render(<DeepTree breadth={breadth} depth={depth} id={0} wrap={wrap} />, node)
|
|
});
|
|
};
|
|
|
|
module.exports = deepTreeBenchmark;
|