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: 
Ben Alpert committed
Mar 13, 2015 at 18:51 UTC
98671fda1aa89b7bb931db3c6ecffa263984c706
1 file changed
+7
-5
src/test/ReactDefaultPerf.js
+7
-5
@@ -163,8 +163,8 @@ var ReactDefaultPerf = {
163
ReactDefaultPerf._allMeasurements.length - 1
164
].totalTime = performanceNow() - start;
165
return rv;
166
- } else if (moduleName === 'ReactDOMIDOperations' ||
167
- moduleName === 'ReactComponentBrowserEnvironment') {
166
+ } else if (fnName === '_mountImageIntoNode' ||
167
+ moduleName === 'ReactDOMIDOperations') {
168
start = performanceNow();
169
rv = func.apply(this, args);
170
totalTime = performanceNow() - start;
@@ -210,6 +210,10 @@ var ReactDefaultPerf = {
210
fnName === 'updateComponent' || // TODO: receiveComponent()?
211
fnName === '_renderValidatedComponent')) {
212
213
+ if (typeof this._currentElement.type === 'string') {
214
+ return func.apply(this, args);
215
+ }
216
+
217
var rootNodeID = fnName === 'mountComponent' ?
218
args[0] :
219
this._rootNodeID;
@@ -243,9 +247,7 @@ var ReactDefaultPerf = {
247
}
248
249
entry.displayNames[rootNodeID] = {
246
- current: typeof this._currentElement.type === 'string' ?
247
- this._currentElement.type :
248
- this.getName(),
250
+ current: this.getName(),
251
owner: this._currentElement._owner ?
252
this._currentElement._owner.getName() :
253
'<root>'