From db21584ba01ee9eda7f36b0e7ba13839b5fb1a47 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Fri, 19 Nov 2021 07:19:59 -0800 Subject: [PATCH] Remove soft error when creating preallocated view Summary: This is expected with Suspense/CM enabled. We are measuring the perf impact of extra CREATE instructions atm, and will revert the change if it regresses too much. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D32558829 fbshipit-source-id: 2e0c91be3aba4ca632814739aed6b8964e21b5a8 --- .../react/fabric/mounting/SurfaceMountingManager.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java index 8e1fe87bd7d5ea..ec082c37dd8aee 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java @@ -19,7 +19,6 @@ import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.ThreadConfined; -import com.facebook.react.bridge.ReactNoCrashSoftException; import com.facebook.react.bridge.ReactSoftExceptionLogger; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; @@ -543,16 +542,12 @@ public void createView( } // We treat this as a perf problem and not a logical error. View Preallocation or unexpected // changes to Differ or C++ Binding could cause some redundant Create instructions. - // This is a NoCrash soft exception because we know there are cases where preallocation happens - // and a node is recreated: if a node is preallocated and then committed with revision 2+, - // an extra CREATE instruction will be generated. + // There are cases where preallocation happens and a node is recreated: if a node is + // preallocated and then committed with revision 2+, an extra CREATE instruction will be + // generated. // This represents a perf issue only, not a correctness issue. In the future we need to // refactor View preallocation to correct the currently incorrect assumptions. if (getNullableViewState(reactTag) != null) { - ReactSoftExceptionLogger.logSoftException( - TAG, - new ReactNoCrashSoftException( - "Cannot CREATE view with tag [" + reactTag + "], already exists.")); return; }