@onekeyfe/react-native-split-bundle-loader 1.1.52 → 1.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -135,15 +135,18 @@ class SplitBundleLoaderModule(reactContext: ReactApplicationContext) :
|
|
|
135
135
|
// #19: Try CatalystInstance first (bridge mode), fall back to
|
|
136
136
|
// ReactHost registerSegment if available (bridgeless / new arch).
|
|
137
137
|
val reactContext = reactApplicationContext
|
|
138
|
+
val segStart = System.nanoTime()
|
|
138
139
|
if (reactContext.hasCatalystInstance()) {
|
|
139
140
|
reactContext.catalystInstance.registerSegment(segId, absolutePath)
|
|
140
|
-
|
|
141
|
+
val segMs = (System.nanoTime() - segStart) / 1_000_000.0
|
|
142
|
+
SBLLogger.info("[SplitBundle] segment $segmentKey (id=$segId) registered in ${String.format("%.1f", segMs)}ms")
|
|
141
143
|
promise.resolve(null)
|
|
142
144
|
} else {
|
|
143
145
|
// Bridgeless: try ReactHost via reflection
|
|
144
146
|
val registered = tryRegisterViaBridgeless(segId, absolutePath)
|
|
147
|
+
val segMs = (System.nanoTime() - segStart) / 1_000_000.0
|
|
145
148
|
if (registered) {
|
|
146
|
-
SBLLogger.info("
|
|
149
|
+
SBLLogger.info("[SplitBundle] segment $segmentKey (id=$segId) registered via bridgeless in ${String.format("%.1f", segMs)}ms")
|
|
147
150
|
promise.resolve(null)
|
|
148
151
|
} else {
|
|
149
152
|
promise.reject(
|
package/ios/SplitBundleLoader.mm
CHANGED
|
@@ -218,15 +218,22 @@
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
NSString *sourceURL = bundlePath.lastPathComponent ?: bundlePath;
|
|
221
|
-
|
|
221
|
+
CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
|
|
222
|
+
[SBLLogger info:[NSString stringWithFormat:@"[SplitBundle] loadEntryBundle: evaluating %@ (%lu bytes)", sourceURL, (unsigned long)data.length]];
|
|
222
223
|
|
|
223
224
|
[instance callFunctionOnBufferedRuntimeExecutor:^(facebook::jsi::Runtime &runtime) {
|
|
224
225
|
@autoreleasepool {
|
|
226
|
+
CFAbsoluteTime evalStart = CFAbsoluteTimeGetCurrent();
|
|
225
227
|
auto buffer = std::make_shared<facebook::jsi::StringBuffer>(
|
|
226
228
|
std::string(static_cast<const char *>(data.bytes), data.length));
|
|
227
229
|
runtime.evaluateJavaScript(std::move(buffer), [sourceURL UTF8String]);
|
|
230
|
+
double evalMs = (CFAbsoluteTimeGetCurrent() - evalStart) * 1000.0;
|
|
231
|
+
[SBLLogger info:[NSString stringWithFormat:@"[SplitBundle] loadEntryBundle: %@ evaluated in %.1fms", sourceURL, evalMs]];
|
|
228
232
|
}
|
|
229
233
|
}];
|
|
234
|
+
|
|
235
|
+
double totalMs = (CFAbsoluteTimeGetCurrent() - startTime) * 1000.0;
|
|
236
|
+
[SBLLogger info:[NSString stringWithFormat:@"[SplitBundle] loadEntryBundle: %@ dispatched in %.1fms (eval is async)", sourceURL, totalMs]];
|
|
230
237
|
}
|
|
231
238
|
|
|
232
239
|
// MARK: - loadSegment
|
|
@@ -240,6 +247,7 @@
|
|
|
240
247
|
{
|
|
241
248
|
@try {
|
|
242
249
|
int segId = (int)segmentId;
|
|
250
|
+
CFAbsoluteTime segStart = CFAbsoluteTimeGetCurrent();
|
|
243
251
|
|
|
244
252
|
// Path traversal guard (#45)
|
|
245
253
|
if ([relativePath containsString:@".."]) {
|
|
@@ -261,7 +269,8 @@
|
|
|
261
269
|
// Register segment (#13: supports both bridge and bridgeless)
|
|
262
270
|
NSError *regError = nil;
|
|
263
271
|
if ([SplitBundleLoader registerSegment:segId path:absolutePath error:®Error]) {
|
|
264
|
-
|
|
272
|
+
double segMs = (CFAbsoluteTimeGetCurrent() - segStart) * 1000.0;
|
|
273
|
+
[SBLLogger info:[NSString stringWithFormat:@"[SplitBundle] Loaded segment %@ (id=%d) in %.1fms", segmentKey, segId, segMs]];
|
|
265
274
|
resolve(nil);
|
|
266
275
|
} else {
|
|
267
276
|
reject(@"SPLIT_BUNDLE_NO_RUNTIME",
|