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:

![image](https://cloud.githubusercontent.com/assets/6820/6649816/4d7202e0-c9b2-11e4-9364-e1b50c96b55b.png)
This commit is contained in:
Ben Alpert
2015-03-13 18:51:53 -07:00
parent 228c00b813
commit 98671fda1a
+7 -5
View File
@@ -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>'