2017-05-25 15:09:55 +03: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 19:59:18 +03: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);
|
|
|
|
}
|
2023-04-03 13:41:10 +03:00
|
|
|
|
2017-05-25 15:09:55 +03:00
|
|
|
marky = require('marky');
|
2017-05-25 22:14:40 +03:00
|
|
|
// allows us to easily do e.g. ReactPerf.printWasted() while debugging
|
2017-09-30 05:29:56 +03:00
|
|
|
//window.ReactPerf = require('react-addons-perf');
|
|
|
|
//window.ReactPerf.start();
|
2017-05-25 15:09:55 +03: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);
|
|
|
|
}
|
|
|
|
}
|