Skip to content

Profiler: Don't count timed out (hidden) subtrees in base duration #18966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented May 20, 2020

The Profiler previously over-reported the base duration value by including times pent in hidden subtrees.

@@ -1725,6 +1725,18 @@ function resetChildLanes(completedWork: Fiber) {
treeBaseDuration += child.treeBaseDuration;
child = child.sibling;
}

const isTimedOutSuspense =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation note: I chose to subtract the base duration value after the child loop, rather than doing the check inline, because a single check with a possible subtraction seemed better than a frequent check inside of the child loop. Happy to refactor if there's concern about the approach.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e7b3c1e:

Sandbox Source
pedantic-keldysh-28ynz Configuration

@sizebot
Copy link

sizebot commented May 20, 2020

Details of bundled changes.

Comparing: a30a1c6...e7b3c1e

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFabric-dev.js +0.1% +0.1% 642.11 KB 642.53 KB 137.77 KB 137.88 KB RN_OSS_DEV
ReactNativeRenderer-dev.js +0.1% +0.1% 660.96 KB 661.38 KB 142.28 KB 142.39 KB RN_OSS_DEV
ReactNativeRenderer-profiling.js +0.1% +0.1% 283.79 KB 284.07 KB 49.25 KB 49.29 KB RN_OSS_PROFILING
ReactFabric-profiling.js +0.1% +0.1% 275.68 KB 275.96 KB 47.72 KB 47.76 KB RN_OSS_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactDOM-profiling.js +0.1% +0.1% 454.74 KB 455.02 KB 80.41 KB 80.46 KB FB_WWW_PROFILING
ReactDOMForked-dev.js 0.0% 0.0% 1.04 MB 1.04 MB 237.66 KB 237.75 KB FB_WWW_DEV
ReactDOMForked-prod.js 0.0% -0.0% 440.87 KB 440.87 KB 79.53 KB 79.53 KB FB_WWW_PROD
react-dom.development.js 0.0% +0.1% 912.23 KB 912.65 KB 200.51 KB 200.61 KB UMD_DEV
ReactDOMForked-profiling.js +0.1% 0.0% 451.19 KB 451.47 KB 81.24 KB 81.28 KB FB_WWW_PROFILING
react-dom.profiling.min.js +0.1% +0.1% 123.86 KB 123.94 KB 39.7 KB 39.73 KB UMD_PROFILING
ReactDOMTesting-dev.js 0.0% -0.0% 957.07 KB 957.07 KB 213.82 KB 213.81 KB FB_WWW_DEV
react-dom.development.js 0.0% +0.1% 868.33 KB 868.73 KB 197.98 KB 198.08 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 120.07 KB 120.07 KB 37.57 KB 37.57 KB NODE_PROD
react-dom-test-utils.development.js 0.0% 0.0% 75.28 KB 75.28 KB 20.18 KB 20.18 KB UMD_DEV
react-dom.profiling.min.js +0.1% +0.1% 124.11 KB 124.19 KB 38.81 KB 38.84 KB NODE_PROFILING
ReactDOM-dev.js 0.0% 0.0% 1.03 MB 1.03 MB 235.43 KB 235.53 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 443.49 KB 443.49 KB 78.55 KB 78.56 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.6 KB 5.6 KB 1.85 KB 1.86 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 5.35 KB 5.35 KB 1.8 KB 1.8 KB UMD_DEV
ReactDOMServer-prod.js 0.0% 0.0% 47.57 KB 47.57 KB 11.13 KB 11.14 KB FB_WWW_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js +0.1% +0.1% 613.36 KB 613.78 KB 129.13 KB 129.22 KB FB_WWW_DEV
ReactART-prod.js 0.0% 0.0% 249.37 KB 249.37 KB 42.62 KB 42.62 KB FB_WWW_PROD
react-art.development.js +0.1% +0.1% 639.74 KB 640.16 KB 135.15 KB 135.24 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 107.56 KB 107.56 KB 32.62 KB 32.62 KB UMD_PROD
react-art.development.js +0.1% +0.1% 543.79 KB 544.19 KB 117.58 KB 117.69 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 72.55 KB 72.55 KB 21.8 KB 21.8 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactTestRenderer-dev.js +0.1% +0.1% 577.19 KB 577.61 KB 122.3 KB 122.41 KB FB_WWW_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 12.73 KB 12.73 KB 3.96 KB 3.96 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 576.58 KB 577 KB 120.34 KB 120.45 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 74.65 KB 74.65 KB 22.75 KB 22.75 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 549.75 KB 550.16 KB 118.92 KB 119.03 KB NODE_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 597.37 KB 597.77 KB 126.82 KB 126.92 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.92 KB 2.92 KB 1.21 KB 1.21 KB NODE_PROD

Size changes (stable)

Generated by 🚫 dangerJS against e7b3c1e

@sizebot
Copy link

sizebot commented May 20, 2020

Details of bundled changes.

Comparing: a30a1c6...e7b3c1e

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-test-utils.development.js 0.0% 0.0% 75.29 KB 75.29 KB 20.19 KB 20.19 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 5.36 KB 5.36 KB 1.8 KB 1.8 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 703 B 704 B UMD_PROD
react-dom.development.js 0.0% 0.0% 946.1 KB 946.52 KB 206.99 KB 207.09 KB UMD_DEV
ReactDOMForked-dev.js 0.0% 0.0% 1.01 MB 1.01 MB 231.83 KB 231.92 KB FB_WWW_DEV
react-dom.profiling.min.js +0.1% 0.0% 128.75 KB 128.83 KB 41.13 KB 41.14 KB UMD_PROFILING
react-dom.development.js 0.0% 0.0% 900.75 KB 901.16 KB 204.42 KB 204.52 KB NODE_DEV
ReactDOMForked-profiling.js +0.1% 0.0% 439.94 KB 440.22 KB 79.36 KB 79.4 KB FB_WWW_PROFILING
react-dom.production.min.js 0.0% 0.0% 124.92 KB 124.92 KB 39.02 KB 39.02 KB NODE_PROD
react-dom-server.browser.production.min.js 0.0% 0.0% 20.3 KB 20.3 KB 7.52 KB 7.52 KB NODE_PROD
react-dom.profiling.min.js +0.1% +0.1% 129.1 KB 129.18 KB 40.33 KB 40.36 KB NODE_PROFILING
ReactDOM-dev.js 0.0% 0.0% 1.01 MB 1.01 MB 229.73 KB 229.82 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 432.42 KB 432.42 KB 76.69 KB 76.7 KB FB_WWW_PROD
ReactDOM-profiling.js +0.1% +0.1% 443.6 KB 443.89 KB 78.56 KB 78.61 KB FB_WWW_PROFILING
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.61 KB 5.61 KB 1.86 KB 1.86 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 70.12 KB 70.12 KB 19.68 KB 19.68 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.87 KB 4.87 KB 1.7 KB 1.7 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.02 KB 1.02 KB 615 B 616 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 664.13 KB 664.55 KB 140.05 KB 140.14 KB UMD_DEV
react-art.development.js +0.1% +0.1% 567.17 KB 567.58 KB 122.53 KB 122.63 KB NODE_DEV
react-art.production.min.js 0.0% -0.0% 75.87 KB 75.87 KB 22.8 KB 22.8 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 603.35 KB 603.77 KB 127.1 KB 127.19 KB FB_WWW_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 12.74 KB 12.74 KB 3.97 KB 3.97 KB UMD_PROD
ReactTestRenderer-dev.js +0.1% +0.1% 577.21 KB 577.62 KB 122.31 KB 122.42 KB FB_WWW_DEV
react-test-renderer.development.js +0.1% +0.1% 576.6 KB 577.03 KB 120.36 KB 120.46 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 74.67 KB 74.67 KB 22.77 KB 22.77 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 549.78 KB 550.18 KB 118.93 KB 119.04 KB NODE_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 623.14 KB 623.54 KB 132.27 KB 132.36 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 85.22 KB 85.22 KB 25.45 KB 25.45 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.93 KB 2.93 KB 1.21 KB 1.21 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFabric-profiling.js +0.1% +0.1% 275.69 KB 275.97 KB 47.73 KB 47.77 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 0.0% 0.0% 272.04 KB 272.04 KB 46.99 KB 46.99 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 283.8 KB 284.08 KB 49.26 KB 49.29 KB RN_OSS_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 665.46 KB 665.87 KB 142.97 KB 143.07 KB RN_FB_DEV
ReactNativeRenderer-profiling.js +0.1% +0.1% 283.75 KB 284.04 KB 49.24 KB 49.27 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 642.12 KB 642.54 KB 137.77 KB 137.88 KB RN_OSS_DEV
ReactFabric-dev.js +0.1% +0.1% 646.61 KB 647.02 KB 138.45 KB 138.55 KB RN_FB_DEV
ReactNativeRenderer-dev.js +0.1% +0.1% 660.98 KB 661.39 KB 142.29 KB 142.4 KB RN_OSS_DEV
ReactFabric-profiling.js +0.1% +0.1% 275.65 KB 275.93 KB 47.71 KB 47.75 KB RN_FB_PROFILING

Size changes (experimental)

Generated by 🚫 dangerJS against e7b3c1e

@bvaughn bvaughn merged commit 22f7663 into facebook:master May 21, 2020
@bvaughn bvaughn deleted the profiler-suspense-base-duration-fix branch May 21, 2020 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants