Skip to content

Commit ee74135

Browse files
axe-fbfacebook-github-bot
authored andcommitted
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
1 parent 9e65223 commit ee74135

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@
77

88
package com.facebook.react.bridge;
99

10+
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
11+
1012
import com.facebook.soloader.SoLoader;
13+
import com.facebook.systrace.Systrace;
1114

1215
public class ReactBridge {
1316
private static boolean sDidInit = false;
1417
public static void staticInit() {
1518
// No locking required here, worst case we'll call into SoLoader twice
1619
// which will do its own locking internally
1720
if (!sDidInit) {
21+
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridge.staticInit::load:reactnativejni");
1822
SoLoader.loadLibrary("reactnativejni");
1923
sDidInit = true;
24+
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
2025
}
2126
}
2227
}

0 commit comments

Comments
 (0)