[Fiber] Performance measurements#9071
Conversation
|
@sebmarkbage @trueadm Ready for review. |
package.json
Outdated
| ], | ||
| "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: facebook/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. |
Reconciliation phase:
Commit phase:
Should work with all Fiber features, including error boundaries and incremental deferred work.
Deferred work example: