mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 22:42:13 +08:00
Measure script conversion time in RCTPLScriptExecution
Reviewed By: alexeylang Differential Revision: D2570036 fb-gh-sync-id: a3ca8cdf0420b0da12b65ac0a672179940b2f818
This commit is contained in:
committed by
facebook-github-bot-9
parent
ce7de93275
commit
afea653cbc
@@ -535,13 +535,14 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
||||
return;
|
||||
}
|
||||
|
||||
RCTPerformanceLoggerStart(RCTPLScriptExecution);
|
||||
|
||||
// JSStringCreateWithUTF8CString expects a null terminated C string
|
||||
NSMutableData *nullTerminatedScript = [NSMutableData dataWithCapacity:script.length + 1];
|
||||
|
||||
[nullTerminatedScript appendData:script];
|
||||
[nullTerminatedScript appendBytes:"" length:1];
|
||||
|
||||
RCTPerformanceLoggerStart(RCTPLScriptExecution);
|
||||
JSValueRef jsError = NULL;
|
||||
JSStringRef execJSString = JSStringCreateWithUTF8CString(nullTerminatedScript.bytes);
|
||||
JSStringRef jsURL = JSStringCreateWithCFString((__bridge CFStringRef)sourceURL.absoluteString);
|
||||
|
||||
Reference in New Issue
Block a user