Summary:
The commit and batch points are just showing up as points in scuba relativity which isn't very useful - we want to know how long they take as well, so make them ranges.

Also adds view creation and update counts as annotations which can be handy for debugging regressions.

Reviewed By: JoshuaGross, axe-fb

Differential Revision: D17083058

fbshipit-source-id: dd29d12731734252930c9a4424bddbb98a8acccf
This commit is contained in:
Spencer Ahrens 2019-08-28 08:46:49 -07:00 коммит произвёл Facebook Github Bot
Родитель 6f2e6f170e
Коммит ed9ecb5d73
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -535,12 +535,16 @@ public class UIViewOperationQueue {
private boolean mIsProfilingNextBatch = false;
private long mNonBatchedExecutionTotalTime;
private long mProfiledBatchCommitStartTime;
private long mProfiledBatchCommitEndTime;
private long mProfiledBatchLayoutTime;
private long mProfiledBatchDispatchViewUpdatesTime;
private long mProfiledBatchRunStartTime;
private long mProfiledBatchRunEndTime;
private long mProfiledBatchBatchedExecutionTime;
private long mProfiledBatchNonBatchedExecutionTime;
private long mThreadCpuTime;
private long mCreateViewCount;
private long mUpdatePropertiesOperationCount;
public UIViewOperationQueue(
ReactApplicationContext reactContext,
@ -568,17 +572,23 @@ public class UIViewOperationQueue {
public void profileNextBatch() {
mIsProfilingNextBatch = true;
mProfiledBatchCommitStartTime = 0;
mCreateViewCount = 0;
mUpdatePropertiesOperationCount = 0;
}
public Map<String, Long> getProfiledBatchPerfCounters() {
Map<String, Long> perfMap = new HashMap<>();
perfMap.put("CommitStartTime", mProfiledBatchCommitStartTime);
perfMap.put("CommitEndTime", mProfiledBatchCommitEndTime);
perfMap.put("LayoutTime", mProfiledBatchLayoutTime);
perfMap.put("DispatchViewUpdatesTime", mProfiledBatchDispatchViewUpdatesTime);
perfMap.put("RunStartTime", mProfiledBatchRunStartTime);
perfMap.put("RunEndTime", mProfiledBatchRunEndTime);
perfMap.put("BatchedExecutionTime", mProfiledBatchBatchedExecutionTime);
perfMap.put("NonBatchedExecutionTime", mProfiledBatchNonBatchedExecutionTime);
perfMap.put("NativeModulesThreadCpuTime", mThreadCpuTime);
perfMap.put("CreateViewCount", mCreateViewCount);
perfMap.put("UpdatePropsCount", mUpdatePropertiesOperationCount);
return perfMap;
}
@ -644,6 +654,7 @@ public class UIViewOperationQueue {
String viewClassName,
@Nullable ReactStylesDiffMap initialProps) {
synchronized (mNonBatchedOperationsLock) {
mCreateViewCount++;
mNonBatchedOperations.addLast(
new CreateViewOperation(themedContext, viewReactTag, viewClassName, initialProps));
}
@ -654,6 +665,7 @@ public class UIViewOperationQueue {
}
public void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props) {
mUpdatePropertiesOperationCount++;
mOperations.add(new UpdatePropertiesOperation(reactTag, props));
}
@ -782,9 +794,11 @@ public class UIViewOperationQueue {
if (mIsProfilingNextBatch && mProfiledBatchCommitStartTime == 0) {
mProfiledBatchCommitStartTime = commitStartTime;
mProfiledBatchCommitEndTime = SystemClock.uptimeMillis();
mProfiledBatchLayoutTime = layoutTime;
mProfiledBatchDispatchViewUpdatesTime = dispatchViewUpdatesTime;
mProfiledBatchRunStartTime = runStartTime;
mProfiledBatchRunEndTime = mProfiledBatchCommitEndTime;
mThreadCpuTime = nativeModulesThreadCpuTime;
Systrace.beginAsyncSection(