mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix up Perf a bit better for 0.13
_mountImageIntoNode moved into ReactMount and wasn't being counted where it was supposed to be. In addition, all DOM elements are now wrapped in a composite wrapper but for the perf tools we want to skip over those or else we'll double-count (at least with the current accounting -- and that's effectively what we did before so this brings us back up to parity). Fixes #3407. Test Plan: Used the jsbin from #3407 and saw similar output from this branch and 0.12: 
This commit is contained in:
@@ -163,8 +163,8 @@ var ReactDefaultPerf = {
|
||||
ReactDefaultPerf._allMeasurements.length - 1
|
||||
].totalTime = performanceNow() - start;
|
||||
return rv;
|
||||
} else if (moduleName === 'ReactDOMIDOperations' ||
|
||||
moduleName === 'ReactComponentBrowserEnvironment') {
|
||||
} else if (fnName === '_mountImageIntoNode' ||
|
||||
moduleName === 'ReactDOMIDOperations') {
|
||||
start = performanceNow();
|
||||
rv = func.apply(this, args);
|
||||
totalTime = performanceNow() - start;
|
||||
@@ -210,6 +210,10 @@ var ReactDefaultPerf = {
|
||||
fnName === 'updateComponent' || // TODO: receiveComponent()?
|
||||
fnName === '_renderValidatedComponent')) {
|
||||
|
||||
if (typeof this._currentElement.type === 'string') {
|
||||
return func.apply(this, args);
|
||||
}
|
||||
|
||||
var rootNodeID = fnName === 'mountComponent' ?
|
||||
args[0] :
|
||||
this._rootNodeID;
|
||||
@@ -243,9 +247,7 @@ var ReactDefaultPerf = {
|
||||
}
|
||||
|
||||
entry.displayNames[rootNodeID] = {
|
||||
current: typeof this._currentElement.type === 'string' ?
|
||||
this._currentElement.type :
|
||||
this.getName(),
|
||||
current: this.getName(),
|
||||
owner: this._currentElement._owner ?
|
||||
this._currentElement._owner.getName() :
|
||||
'<root>'
|
||||
|
||||
Reference in New Issue
Block a user