# CompilationMode.Partial

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/CompilationMode.kt+class:androidx.benchmark.macro.CompilationMode.Partial) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.1.0)

*** ** * ** ***

<br />

```
class CompilationMode.Partial : CompilationMode
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.benchmark.macro.CompilationMode](https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode) ||
|   | ↳ | [androidx.benchmark.macro.CompilationMode.Partial](https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial) |

*** ** * ** ***

Partial ahead-of-time app compilation.

The default parameters for this mimic the default state of an app partially pre-compiled by the installer - such as via Google Play.

Either `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#baselineProfileMode()` must be set to non-`https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileMode#Disable`, or `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#warmupIterations()` must be set to a non-`0` value.

Note: `[baselineProfileMode] = [BaselineProfileMode.Require]` is only supported for APKs that have the ProfileInstaller library included, and have been built by AGP 7.0+ to package the baseline profile in the APK.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#Partial(androidx.benchmark.macro.BaselineProfileMode,kotlin.Int)( baselineProfileMode: https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileMode, warmupIterations: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileMode` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#baselineProfileMode()` Controls whether a Baseline Profile should be used to partially pre compile the app. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#warmupIterations()` If greater than 0, your macrobenchmark will run an extra `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#(androidx.benchmark.macro.BaselineProfileMode,kotlin.Int)` times before compilation, to prepare |

## Public constructors

### Partial

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

```
Partial(
    baselineProfileMode: BaselineProfileMode = BaselineProfileMode.Require,
    warmupIterations: @IntRange(from = 0) Int = 0
)
```

## Public functions

### toString

```
open fun toString(): String
```

## Public properties

### baselineProfileMode

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

```
val baselineProfileMode: BaselineProfileMode
```

Controls whether a Baseline Profile should be used to partially pre compile the app.

Defaults to `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileMode#Require`

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/BaselineProfileMode` |   |

### warmupIterations

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

```
val warmupIterations: @IntRange(from = 0) Int
```

If greater than 0, your macrobenchmark will run an extra `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/CompilationMode.Partial#(androidx.benchmark.macro.BaselineProfileMode,kotlin.Int)` times before compilation, to prepare