Skip to content

Commit

Permalink
QE setup for pre-allocation optimization
Browse files Browse the repository at this point in the history
Summary: QE setup for pre-allocation optimization

Reviewed By: fabiocarballo

Differential Revision: D55317260

fbshipit-source-id: b6964f299faa8c9b405e8eca5f9cce6c0a46c5d8
  • Loading branch information
kingsleyadio authored and facebook-github-bot committed Mar 27, 2024
1 parent 1d2c826 commit a66b7c2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.facebook.litho.ComponentTreeDebugEventListener
import com.facebook.litho.ComponentsLogger
import com.facebook.litho.DefaultErrorEventHandler
import com.facebook.litho.ErrorEventHandler
import com.facebook.litho.config.ComponentsConfiguration.Builder
import com.facebook.litho.perfboost.LithoPerfBoosterFactory
import com.facebook.rendercore.incrementalmount.IncrementalMountExtensionConfigs

Expand Down Expand Up @@ -281,6 +282,7 @@ internal constructor(
private var debugEventListener = baseConfig.debugEventListener
private var shouldBuildRenderTreeInBg = baseConfig.shouldBuildRenderTreeInBg
private var enablePreAllocationSameThreadCheck = baseConfig.enablePreAllocationSameThreadCheck
private var avoidRedundantPreAllocations = baseConfig.avoidRedundantPreAllocations

fun shouldNotifyVisibleBoundsChangeWhenNestedLithoViewBecomesInvisible(
enabled: Boolean
Expand Down Expand Up @@ -354,6 +356,10 @@ internal constructor(
enablePreAllocationSameThreadCheck = value
}

fun avoidRedundantPreAllocations(value: Boolean): Builder = also {
avoidRedundantPreAllocations = value
}

fun build(): ComponentsConfiguration {
return baseConfig.copy(
specsApiStateUpdateDuplicateDetectionEnabled =
Expand Down Expand Up @@ -383,6 +389,7 @@ internal constructor(
shouldBuildRenderTreeInBg = shouldBuildRenderTreeInBg,
shouldReuseIdToPositionMap = shouldBuildRenderTreeInBg,
enablePreAllocationSameThreadCheck = enablePreAllocationSameThreadCheck,
avoidRedundantPreAllocations = avoidRedundantPreAllocations,
)
}
}
Expand Down

0 comments on commit a66b7c2

Please sign in to comment.