Skip to content

Commit

Permalink
Remove createMountItem code
Browse files Browse the repository at this point in the history
Summary:
Now that pre-allocation of views update props, we can just force the execution of "pre-allocation" instead of "create" mount item.

This diff removes the methods that were used by view creation

This way we reduce the amount of mountItems that are created during commit phase.
This should improve TTI (I'm running a MobileLab)

Reviewed By: shergin

Differential Revision: D14297477

fbshipit-source-id: a100bab798467e9f0fa9773e0206ba1ded472298
  • Loading branch information
mdvacca authored and facebook-github-bot committed Mar 3, 2019
1 parent 7720613 commit d451c03
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.facebook.react.fabric.mounting.MountingManager;
import com.facebook.react.fabric.mounting.ViewPool;
import com.facebook.react.fabric.mounting.mountitems.BatchMountItem;
import com.facebook.react.fabric.mounting.mountitems.CreateMountItem;
import com.facebook.react.fabric.mounting.mountitems.DeleteMountItem;
import com.facebook.react.fabric.mounting.mountitems.DispatchCommandMountItem;
import com.facebook.react.fabric.mounting.mountitems.InsertMountItem;
Expand Down Expand Up @@ -94,7 +93,6 @@ private static void loadClasses() {
FabricUIManager.class.getClass();
GuardedFrameCallback.class.getClass();
BatchMountItem.class.getClass();
CreateMountItem.class.getClass();
DeleteMountItem.class.getClass();
DispatchCommandMountItem.class.getClass();
InsertMountItem.class.getClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import com.facebook.react.fabric.jsi.FabricSoLoader;
import com.facebook.react.fabric.mounting.MountingManager;
import com.facebook.react.fabric.mounting.mountitems.BatchMountItem;
import com.facebook.react.fabric.mounting.mountitems.CreateMountItem;
import com.facebook.react.fabric.mounting.mountitems.DeleteMountItem;
import com.facebook.react.fabric.mounting.mountitems.DispatchCommandMountItem;
import com.facebook.react.fabric.mounting.mountitems.InsertMountItem;
Expand Down Expand Up @@ -162,22 +161,7 @@ public void removeRootView(int reactRootTag) {
mMountingManager.removeRootView(reactRootTag);
mReactContextForRootTag.remove(reactRootTag);
}

@DoNotStrip
@SuppressWarnings("unused")
private MountItem createMountItem(
String componentName, int reactRootTag, int reactTag, boolean isVirtual, ReadableMap props) {
String component = sComponentNames.get(componentName);
if (component == null) {
throw new IllegalArgumentException("Unable to find component with name " + componentName);
}
ThemedReactContext reactContext = mReactContextForRootTag.get(reactRootTag);
if (reactContext == null) {
throw new IllegalArgumentException("Unable to find ReactContext for root: " + reactRootTag);
}
return new CreateMountItem(reactContext, component, reactTag, isVirtual, props);
}


@Override
public void initialize() {
mEventDispatcher.registerEventEmitter(FABRIC, new FabricEventEmitter(this));
Expand Down

This file was deleted.

0 comments on commit d451c03

Please sign in to comment.