From e4dca7a1fa29bf500849a0fea4f0f6ecc3581293 Mon Sep 17 00:00:00 2001 From: Milen Dzhumerov Date: Mon, 23 Nov 2015 07:01:11 -0800 Subject: [PATCH] Add JSON methods to systrace Summary: public Add JSON methods to systraces Reviewed By: jspahrsummers Differential Revision: D2679719 fb-gh-sync-id: d8bbdc9577264b1de01d7bb52656f4f1a86a5982 --- Libraries/Utilities/BridgeProfiling.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Libraries/Utilities/BridgeProfiling.js b/Libraries/Utilities/BridgeProfiling.js index e707b357d..f71b6511c 100644 --- a/Libraries/Utilities/BridgeProfiling.js +++ b/Libraries/Utilities/BridgeProfiling.js @@ -80,6 +80,15 @@ var BridgeProfiling = { } catch(err) {} }, + /* This is not called by default due to perf overhead but it's useful + if you want to find traces which spend too much time in JSON. */ + swizzleJSON() { + BridgeProfiling.measureMethods(JSON, 'JSON', [ + 'parse', + 'stringify' + ]); + }, + /** * Measures multiple methods of a class. For example, you can do: * BridgeProfiling.measureMethods(JSON, 'JSON', ['parse', 'stringify']);