diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java index abbe9c3f83f..9c7c31ec629 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java @@ -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 getProfiledBatchPerfCounters() { Map 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(