From 864a30185d08bdf38bbabee74316ec42dca2bc4b Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Mon, 11 Feb 2019 16:26:00 -0800 Subject: [PATCH] Add more init perf markers Summary: Adding some more systrace markers to track load application and the initial bits of MarketplaceHomeApp. There are a couple big segments worth pointing out with timing from a local `__DEV__: false` run: * JSBundleRequireTime_end -> BundlePreInitializeCore_start: 360ms * MobileConfigModuleInit: 210ms * renderApplication_React_render_start -> MarketplaceHomeAppConstructorSuper_start: 180ms * MarketplaceHomeAppGetQueryParamsForCachedTopPicks: 100ms I'm not sure what we can do about any of these except for MarketplaceHomeAppGetQueryParamsForCachedTopPicks where we could break the query params out into a separate file so we don't have to load this 11-thousand-line behemoth just so we can get this snippet: diffusion/FBS/browse/master/xplat/js/RKJSModules/Apps/Wilde/Marketplace/apps/__generated__/MarketplaceHomeAppQuery.graphql.js$11831-11837 But maybe we have to load it anyway and the query just needs to be optimized (or maybe Relay can optimize the format here). Reviewed By: yungsters Differential Revision: D13969695 fbshipit-source-id: 4f39efa6cb591b814687bfe51b02ad92048f1c21 --- Libraries/ReactNative/renderApplication.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/ReactNative/renderApplication.js b/Libraries/ReactNative/renderApplication.js index 805ce89bb..694567726 100644 --- a/Libraries/ReactNative/renderApplication.js +++ b/Libraries/ReactNative/renderApplication.js @@ -11,6 +11,7 @@ 'use strict'; const AppContainer = require('AppContainer'); +import PerformanceLogger from 'PerformanceLogger'; const React = require('React'); const ReactFabricIndicator = require('ReactFabricIndicator'); @@ -53,11 +54,13 @@ function renderApplication( renderable = {renderable}; } + PerformanceLogger.startTimespan('renderApplication_React_render'); if (fabric) { require('ReactFabric').render(renderable, rootTag); } else { require('ReactNative').render(renderable, rootTag); } + PerformanceLogger.stopTimespan('renderApplication_React_render'); } module.exports = renderApplication;