# 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 />

```
public final class CompilationMode.Partial extends CompilationMode
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.benchmark.macro.CompilationMode](https://developer.android.com/reference/androidx/benchmark/macro/CompilationMode) ||
|   | ↳ | [androidx.benchmark.macro.CompilationMode.Partial](https://developer.android.com/reference/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/androidx/benchmark/macro/CompilationMode.Partial#baselineProfileMode()` must be set to non-`https://developer.android.com/reference/androidx/benchmark/macro/BaselineProfileMode#Disable`, or `https://developer.android.com/reference/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/androidx/benchmark/macro/CompilationMode.Partial#Partial(androidx.benchmark.macro.BaselineProfileMode,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/macro/BaselineProfileMode baselineProfileMode, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int warmupIterations )` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/macro/BaselineProfileMode` | `https://developer.android.com/reference/androidx/benchmark/macro/CompilationMode.Partial#getBaselineProfileMode()()` Controls whether a Baseline Profile should be used to partially pre compile the app. |
| `final int` | `https://developer.android.com/reference/androidx/benchmark/macro/CompilationMode.Partial#getWarmupIterations()()` If greater than 0, your macrobenchmark will run an extra `https://developer.android.com/reference/androidx/benchmark/macro/CompilationMode.Partial#(androidx.benchmark.macro.BaselineProfileMode,kotlin.Int)` times before compilation, to prepare |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/benchmark/macro/CompilationMode.Partial#toString()()` |

## Public constructors

### Partial

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

```
public Partial(
    @NonNull BaselineProfileMode baselineProfileMode,
    @IntRange(from = 0) int warmupIterations
)
```

## Public methods

### getBaselineProfileMode

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

```
public final @NonNull BaselineProfileMode getBaselineProfileMode()
```

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

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

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

### getWarmupIterations

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

```
public final int getWarmupIterations()
```

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

### toString

```
public @NonNull String toString()
```