mirror of
https://github.com/status-im/react-native.git
synced 2025-01-24 16:29:01 +00:00
Remove unused RCTRenderingPerf
Reviewed By: josephsavona Differential Revision: D5292898 fbshipit-source-id: 33605c994c3457134556acc328542611a2247d27
This commit is contained in:
parent
09ba07e4fa
commit
94d9f00dd6
@ -217,10 +217,6 @@ if (__DEV__) {
|
||||
|
||||
require('RCTDebugComponentOwnership');
|
||||
|
||||
// In order to use Cmd+P to record/dump perf data, we need to make sure
|
||||
// this module is available in the bundle
|
||||
require('RCTRenderingPerf');
|
||||
|
||||
// Set up inspector
|
||||
const JSInspector = require('JSInspector');
|
||||
JSInspector.registerAgent(require('NetworkAgent'));
|
||||
|
@ -1,61 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule RCTRenderingPerf
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var performanceNow = require('fbjs/lib/performanceNow');
|
||||
|
||||
type perfModule = {
|
||||
start: () => void,
|
||||
stop: () => void,
|
||||
}
|
||||
|
||||
var perfModules = [];
|
||||
var enabled = false;
|
||||
|
||||
var RCTRenderingPerf = {
|
||||
// Once perf is enabled, it stays enabled
|
||||
toggle: function() {
|
||||
console.log('Render perfomance measurements enabled');
|
||||
enabled = true;
|
||||
},
|
||||
|
||||
start: function() {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
perfModules.forEach((module) => module.start());
|
||||
},
|
||||
|
||||
stop: function() {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
perfModules.forEach((module) => module.stop());
|
||||
},
|
||||
|
||||
register: function(module: perfModule) {
|
||||
invariant(
|
||||
typeof module.start === 'function',
|
||||
'Perf module should have start() function'
|
||||
);
|
||||
invariant(
|
||||
typeof module.stop === 'function',
|
||||
'Perf module should have stop() function'
|
||||
);
|
||||
perfModules.push(module);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = RCTRenderingPerf;
|
Loading…
x
Reference in New Issue
Block a user