BaselineProfileConfig.Builder


class BaselineProfileConfig.Builder


Can be used to build a androidx.benchmark.macro.BaselineProfileConfig instance.

Summary

Public constructors

Builder(packageName: String, profileBlock: MacrobenchmarkScope.() -> Unit)

Public functions

BaselineProfileConfig
BaselineProfileConfig.Builder
setFilterPredicate(filterPredicate: (String) -> Boolean)

Overrides the function used to filter individual rules / lines of the baseline profile.

BaselineProfileConfig.Builder
setIncludeInStartupProfile(includeInStartupProfile: Boolean)

Overrides the bit that determines whether the generated profile should be also used as a startup profile.

BaselineProfileConfig.Builder
setMaxIterations(maxIterations: Int)

Overrides the maximum number of iterations to run when collecting profiles.

BaselineProfileConfig.Builder
setOutputFilePrefix(outputFilePrefix: String)

Sets the optional file name prefix used when creating the output file with the contents of the human readable baseline profile.

BaselineProfileConfig.Builder
setStableIterations(stableIterations: Int)

Overrides the minimum number of iterations to observe as stable before assuming stability, and completing profile generation.

BaselineProfileConfig.Builder
setStrictStability(strictStability: Boolean)

Overrides the bit that enforces if the generated profile was stable

Public constructors

Builder

Added in 1.4.0-beta02
Builder(packageName: String, profileBlock: MacrobenchmarkScope.() -> Unit)

Public functions

setFilterPredicate

Added in 1.4.0-beta02
fun setFilterPredicate(filterPredicate: (String) -> Boolean): BaselineProfileConfig.Builder

Overrides the function used to filter individual rules / lines of the baseline profile. By default, no filters are applied. Note that this works only when the target application's code is not obfuscated.

setIncludeInStartupProfile

Added in 1.4.0-beta02
fun setIncludeInStartupProfile(includeInStartupProfile: Boolean): BaselineProfileConfig.Builder

Overrides the bit that determines whether the generated profile should be also used as a startup profile. A startup profile is utilized during the build process in order to determine which classes are needed in the primary dex to optimize the startup time. This flag should be used only for startup flows, such as main application startup pre and post login or other entry points of the app. Note that methods collected in a startup profiles are also utilized for baseline profiles.

setMaxIterations

Added in 1.4.0-beta02
fun setMaxIterations(maxIterations: Int): BaselineProfileConfig.Builder

Overrides the maximum number of iterations to run when collecting profiles.

setOutputFilePrefix

Added in 1.4.0-beta02
fun setOutputFilePrefix(outputFilePrefix: String): BaselineProfileConfig.Builder

Sets the optional file name prefix used when creating the output file with the contents of the human readable baseline profile. For example: outputFilePrefix-baseline-prof.txt

setStableIterations

Added in 1.4.0-beta02
fun setStableIterations(stableIterations: Int): BaselineProfileConfig.Builder

Overrides the minimum number of iterations to observe as stable before assuming stability, and completing profile generation.

setStrictStability

Added in 1.4.0-beta02
fun setStrictStability(strictStability: Boolean): BaselineProfileConfig.Builder

Overrides the bit that enforces if the generated profile was stable