This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-05-25 05:09:55 -07:00
|
|
|
//
|
|
|
|
// Tools for performance debugging, only enabled in development mode.
|
|
|
|
// Open up Chrome Dev Tools, then Timeline, then User Timing to see output.
|
|
|
|
// Also see config/webpack/loaders/mark.js for the webpack loader marks.
|
|
|
|
//
|
|
|
|
|
|
|
|
let marky;
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
2017-05-25 09:59:18 -07:00
|
|
|
if (typeof performance !== 'undefined' && performance.setResourceTimingBufferSize) {
|
|
|
|
// Increase Firefox's performance entry limit; otherwise it's capped to 150.
|
|
|
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331135
|
|
|
|
performance.setResourceTimingBufferSize(Infinity);
|
|
|
|
}
|
2017-05-25 05:09:55 -07:00
|
|
|
marky = require('marky');
|
2017-05-25 12:14:40 -07:00
|
|
|
// allows us to easily do e.g. ReactPerf.printWasted() while debugging
|
2017-09-29 19:29:56 -07:00
|
|
|
//window.ReactPerf = require('react-addons-perf');
|
|
|
|
//window.ReactPerf.start();
|
2017-05-25 05:09:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export function start(name) {
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
marky.mark(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function stop(name) {
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
marky.stop(name);
|
|
|
|
}
|
|
|
|
}
|