Created
August 16, 2016 09:32
-
-
Save davidszotten/5535eb5ff98b68cae9791edd9bc0e1bf to your computer and use it in GitHub Desktop.
React profiling bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Perf = React.addons.Perf; | |
var is_active = window.reactProfileActive || false; | |
if (!is_active) { | |
Perf.start(); | |
} | |
else { | |
Perf.start(); | |
measurements = Perf.getLastMeasurements(); | |
Perf.printInclusive(measurements); | |
Perf.printWasted(measurements); | |
window.reactMeasurements = measurements; | |
} | |
window.reactProfileActive = !is_active; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment