BaselineProfileConfig.Builder
public final class BaselineProfileConfig.Builder
Can be used to build a androidx.benchmark.macro.BaselineProfileConfig instance.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
final @NonNull BaselineProfileConfig |
build() |
final @NonNull BaselineProfileConfig.Builder |
Overrides the function used to filter individual rules / lines of the baseline profile. |
final @NonNull BaselineProfileConfig.Builder |
setIncludeInStartupProfile(boolean includeInStartupProfile)Overrides the bit that determines whether the generated profile should be also used as a startup profile. |
final @NonNull BaselineProfileConfig.Builder |
setMaxIterations(int maxIterations)Overrides the maximum number of iterations to run when collecting profiles. |
final @NonNull BaselineProfileConfig.Builder |
setOutputFilePrefix(@NonNull String outputFilePrefix)Sets the optional file name prefix used when creating the output file with the contents of the human readable baseline profile. |
final @NonNull BaselineProfileConfig.Builder |
setStableIterations(int stableIterations)Overrides the minimum number of iterations to observe as stable before assuming stability, and completing profile generation. |
final @NonNull BaselineProfileConfig.Builder |
setStrictStability(boolean strictStability)Overrides the bit that enforces if the generated profile was stable |
Public constructors
Public methods
build
public final @NonNull BaselineProfileConfig build()
| Returns | |
|---|---|
@NonNull BaselineProfileConfig |
the |
setFilterPredicate
public final @NonNull BaselineProfileConfig.Builder setFilterPredicate(
@NonNull Function1<@NonNull String, @NonNull Boolean> filterPredicate
)
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.
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |
setIncludeInStartupProfile
public final @NonNull BaselineProfileConfig.Builder setIncludeInStartupProfile(boolean includeInStartupProfile)
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.
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |
setMaxIterations
public final @NonNull BaselineProfileConfig.Builder setMaxIterations(int maxIterations)
Overrides the maximum number of iterations to run when collecting profiles.
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |
setOutputFilePrefix
public final @NonNull BaselineProfileConfig.Builder setOutputFilePrefix(@NonNull String outputFilePrefix)
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
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |
setStableIterations
public final @NonNull BaselineProfileConfig.Builder setStableIterations(int stableIterations)
Overrides the minimum number of iterations to observe as stable before assuming stability, and completing profile generation.
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |
setStrictStability
public final @NonNull BaselineProfileConfig.Builder setStrictStability(boolean strictStability)
Overrides the bit that enforces if the generated profile was stable
| Returns | |
|---|---|
@NonNull BaselineProfileConfig.Builder |
The |