From ee74135a46ed1757a2f67e74a116a6ccfcdf7552 Mon Sep 17 00:00:00 2001 From: Ram N Date: Mon, 1 Oct 2018 13:41:49 -0700 Subject: [PATCH] Add tracing to when SO libraries are loaded Summary: Currently, loading SO libraries is pretty expensive. While they are triggered due to accessing `ReadableNativeArray`. However, with preloader experiments, this block seems to move around and is loaded when the first dependent class loads it. Also, as a part of D10108380, this will be moved again. Adding a trace to keep track of where it moves. Reviewed By: achen1 Differential Revision: D9890280 fbshipit-source-id: 4b331ef1d7e824935bf3708442537349d2d631d0 --- .../src/main/java/com/facebook/react/bridge/ReactBridge.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java index 66123de02..a116d8781 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java @@ -7,7 +7,10 @@ package com.facebook.react.bridge; +import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE; + import com.facebook.soloader.SoLoader; +import com.facebook.systrace.Systrace; public class ReactBridge { private static boolean sDidInit = false; @@ -15,8 +18,10 @@ public class ReactBridge { // No locking required here, worst case we'll call into SoLoader twice // which will do its own locking internally if (!sDidInit) { + Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridge.staticInit::load:reactnativejni"); SoLoader.loadLibrary("reactnativejni"); sDidInit = true; + Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } }