[Fiber] Performance measurements - #9071
Conversation
|
@sebmarkbage @trueadm Ready for review. |
| ], | ||
| "setupTestFrameworkScriptFile": "./scripts/jest/test-framework-setup.js", | ||
| "testRegex": "/__tests__/", | ||
| "testRegex": "/__tests__/.*\\.js$", |
There was a problem hiding this comment.
This fixes an issue that caused Jest to treat snapshot files as test suites. Also matches Jest docs.
|
Great work @gaearon. Integration into the timeline will really help make sense of what's happening. If this is going to be on by default, a way to disable it would be useful. I regularly use user timing for other purposes too. |
|
Ideally it would be great if instead of exposing API to disable it, browsers just had a way to filter out measurements you're not interested in. Related: w3c/user-timing#24, w3c/charter-webperf#28. cc @paulirish |
|
React Native PR: react/react-native#12797 |
trueadm
left a comment
There was a problem hiding this comment.
Looks good to me, but I'd add some dev blocks as per my comments to 100% make sure the code isn't shipped in prod
| getPublicInstance, | ||
| } = config; | ||
|
|
||
| function callComponentWillUnmountWithTimerInDev(current, instance) { |
There was a problem hiding this comment.
Will this be stripped properly? Maybe it's best to also put it in a dev block?
There was a problem hiding this comment.
It should be because Uglify will find no references to it. At least I think we've been doing this in many places and it worked before.
There was a problem hiding this comment.
That's cool. Would be good validate as this is something we can improve with flat bundling if it's not happening here.
There was a problem hiding this comment.
Just checked, and it's stripped out. I'll gate by DEV for more explicitness.
| stopCommitHostEffectsTimer, | ||
| startCommitLifeCyclesTimer, | ||
| stopCommitLifeCyclesTimer, | ||
| } = require('ReactDebugFiberPerf'); |
There was a problem hiding this comment.
dev block for this require too?
There was a problem hiding this comment.
I think it's inside a DEV block (it's just a long one 😄 )
|
This PR is already pretty long so I'm going to get this in and address any further comments on top. |
* wip * better * better * track commits * better * wip * Fix * Add some lifecycles * wip * Naming * Moar emojis * Remove stacks in favor of a flag * Fix Flow * Gate behind __DEV__ * Revert flag for testing * Measure all lifecycles * Push it to the limits * Polish * Indent * Refactor and track cascading updates * More prominent warnings * Make mark names themselves readable This is useful for RN Systrace which doesn't let us assign labels after the fact. * Keep track of how many effects we call * Fix typo * Do less work to reduce the overhead * Fix lint * Remove closure * Remove unintentional formatting changes * Add tests * Fix test regex and record tests * Disable irrelevant tests needed for ReactPerf * Fix typo * Fix lint and flow * Don't treat cWM or cWRP as cascading * Whitespace * Update tests * Gate callComponentWillUnmountWithTimerInDev definition by DEV
Reconciliation phase:
Commit phase:
Should work with all Fiber features, including error boundaries and incremental deferred work.
Deferred work example: