Skip to content

Commit

Permalink
Enable preallocaiton in Comments Mount Content
Browse files Browse the repository at this point in the history
Summary: There were a lot of mount content which were not preallocation eligible (and that is why likely the QE didn't show improvements in the first place).

Reviewed By: jettbow

Differential Revision: D53040284

fbshipit-source-id: ebf5498f3f00ab2da39a881b5f3f5fde7726de73
  • Loading branch information
Fabio Carballo authored and facebook-github-bot committed Jan 24, 2024
1 parent a3578d1 commit b6960f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions litho-core/src/main/java/com/facebook/litho/LayoutState.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ void preAllocateMountContent(boolean shouldPreallocatePerMountSpec) {

if (mEnableDrawablePreallocation || isMountableView(treeNode.getRenderUnit())) {

if (isTracing) {
ComponentsSystrace.beginSection("preallocateMount: " + component.getSimpleName());
}

boolean preallocated =
MountItemsPool.maybePreallocateContent(
mResolveResult.context.getAndroidContext(),
Expand All @@ -354,6 +358,10 @@ void preAllocateMountContent(boolean shouldPreallocatePerMountSpec) {
"Preallocation of "
+ component.getSimpleName()
+ (preallocated ? " succeeded" : " failed"));

if (isTracing) {
ComponentsSystrace.endSection();
}
}
}
}
Expand Down

0 comments on commit b6960f4

Please sign in to comment.