# Compilation Avoidance

DevFeed: [Compilation Avoidance](<https://devfeed.tech/articles/compilation-avoidance-24603.md>)

Original publisher: [Read original article](<https://blog.gradle.org/compilation-avoidance>)

Author: Amanda Martin

Published: 2022-11-28T05:00:00Z

Content type: tutorial

Language: en

Sources: [The Gradle Blog](<https://devfeed.tech/sources/the-gradle-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [build performance](<https://devfeed.tech/topics/build-performance.md>), [build times](<https://devfeed.tech/topics/build-times.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [build-performance](<https://devfeed.tech/tags/build-performance.md>), [build-times](<https://devfeed.tech/tags/build-times.md>), [ci](<https://devfeed.tech/tags/ci.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [incremental](<https://devfeed.tech/tags/incremental.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>)

## AI overview

This article explains Gradle's compilation avoidance on the JVM. Gradle uses application binary interfaces to determine whether dependency changes require recompilation, allowing ABI-compatible implementation changes to skip downstream compilation and improving build performance locally and on CI.

## Source excerpt

We've recently noticed some community chatter about speeding up Gradle compilation on the JVM by ignoring changes not affecting the ABIs of dependencies. What a great idea! In fact, Gradle has used ABIs for Java out of the box for this without any extra configuration since version 3.4. We refer to this feature as compilation avoidance. This post explains what ABI-based compilation means for the average workflow. Spoiler: utilizing compilation avoidance is one of the best performance enhancements for any build. What is an application binary interface? An application binary interface (ABI) is the interface generated from compiling software that defines internal and external interaction. The ABI represents what is visible to consumers at compile time. When compiling a project, the presence or absence of changes in the ABIs of any of its dependencies determines if compilation is up-to-date or if recompilation is required. These ABIs consist of all the public information about the dependencies that is visible to a consumer project, such as: any public methods with their argument types and the return statements any public properties and fields any dependencies used to compile against the ABI. When a person accesses a library in source code, they use an API of the library. When a machine accesses compiled binaries, it uses the ABI. Why are ABIs relevant for build performance? Modern build systems consider ABI compatibility when compiling code to avoid as much compilation as possible when compiling incremental changes to the codebase. Changes to internal implementation details are ABI-compatible: they do not change the public interface. In practice, the internal implementation details of a project change much more frequently than the public components. When public information does not change, any downstream projects will not need to be recompiled. Skipping that extra work can have a massive impact on the build performance of a large project, both locally and on CI. Changes