# BaselineProfileConfig.Builder

Artifact: [androidx.benchmark:benchmark-macro](https://developer.android.com/jetpack/androidx/releases/benchmark) [View Source](https://cs.android.com/search?q=file:androidx/benchmark/macro/BaselineProfileConfig.kt+class:androidx.benchmark.macro.BaselineProfileConfig.Builder) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

*** ** * ** ***


```
class BaselineProfileConfig.Builder
```

<br />

*** ** * ** ***

Can be used to build a `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig` instance.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#Builder(kotlin.String,kotlin.Function1)(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, profileBlock: https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MacrobenchmarkScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#build()()` |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setFilterPredicate(kotlin.Function1)(filterPredicate: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Overrides the function used to filter individual rules / lines of the baseline profile. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setIncludeInStartupProfile(kotlin.Boolean)(includeInStartupProfile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Overrides the bit that determines whether the generated profile should be also used as a startup profile. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setMaxIterations(kotlin.Int)(maxIterations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Overrides the maximum number of iterations to run when collecting profiles. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setOutputFilePrefix(kotlin.String)(outputFilePrefix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets the optional file name prefix used when creating the output file with the contents of the human readable baseline profile. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setStableIterations(kotlin.Int)(stableIterations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Overrides the minimum number of iterations to observe as stable before assuming stability, and completing profile generation. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder#setStrictStability(kotlin.Boolean)(strictStability: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Overrides the bit that enforces if the generated profile was stable |

## Public constructors

### Builder

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

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

## Public functions

### build

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
fun build(): BaselineProfileConfig
```

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig` | the `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig` instance. |

### setFilterPredicate

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
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.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |

### setIncludeInStartupProfile

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
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.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |

### setMaxIterations

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
fun setMaxIterations(maxIterations: Int): BaselineProfileConfig.Builder
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |

### setOutputFilePrefix

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
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`

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |

### setStableIterations

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
fun setStableIterations(stableIterations: Int): BaselineProfileConfig.Builder
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |

### setStrictStability

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
fun setStrictStability(strictStability: Boolean): BaselineProfileConfig.Builder
```

Overrides the bit that enforces if the generated profile was stable

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` | The `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileConfig.Builder` instance for chaining. |