iOS:Add PerformanceProfile

This commit is contained in:
pengfei.zhou
2021-03-29 17:53:27 +08:00
committed by osborn
parent 51719d3fc7
commit a40413f991
7 changed files with 174 additions and 0 deletions

View File

@@ -33,12 +33,14 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
if (!argument) {
return;
}
[self.doricContext.performanceProfile prepare:@"Render"];
__weak typeof(self) _self = self;
[self.doricContext dispatchToMainQueue:^{
__strong typeof(_self) self = _self;
if (self.doricContext == nil) {
return;
}
[self.doricContext.performanceProfile start:@"Render"];
NSString *viewId = [argument optString:@"id"];
if (self.doricContext.rootNode.viewId == nil && [@"Root" isEqualToString:[argument optString:@"type"]]) {
@@ -51,6 +53,7 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
[viewNode requestLayout];
}
[promise resolve:nil];
[self.doricContext.performanceProfile end:@"Render"];
}];
}