Skip to main content

Why does my build take longer on Bitrise than on my machine?

Updated over 2 weeks ago

Issue

Your build times on Bitrise are higher compared to builds on your local machine.

Possible solutions

First, find out which Step(s) take a significant time in your build.

  • If your dependency steps (for example, CocoaPods Install) take a long time, try implementing dependency caching to speed it up.

  • If the long build time is related to an archive/test step, and does not rely on a third-party service, the following section might help.

Local build caching

Most of the tools you use (for example, Xcode) do a lot of local build caching to speed up subsequent builds. These caches help a lot to decrease the build time on your Mac/PC, but these are not available on bitrise.io.

On bitrise.io every build runs in a clean Virtual Machine (VM). No file is stored after your build finishes. The VM instance is destroyed, and subsequent builds will start in a clean VM.

In your local build cache, there might be files that are not in your repository. This means that if you do a git clone of your project, your build will fail as these files are not present.

This issue is eliminated by using clean VMs on bitrise.io, where only the code and dependencies you specify (which are under version control, and are reproducible) are available.

If it works on a clean VM machine on Bitrise, then it should work on a brand new Mac/PC as well - for example, when a new colleague joins your team and starts to work on the project.

Network Resources

If your project requires dependencies which have to be retrieved from the Internet, it’ll add time to the build process.

For example, when you build your iOS project on your Mac and you use CocoaPods, you usually don’t have to run pod install, only when your CocoaPods dependency list changes. If you don’t commit your Pods into your repository then this process (to download the required dependencies) have to be performed for every build in a clean environment.

You can:

  • Commit your dependencies to your repository.

  • Gradle/Bazel Builds
    The Bitrise build cache is a custom, hosted implementation of the caching solutions of certain build systems. You can use the remote cache both locally and in the Bitrise CI environment: in this way your builds will work consistently regardless of the environment and you can save a significant amount of build time.


    Bitrise supports remote build caching for two build systems:

Raw performance

We always try to improve the overall performance of the build infrastructure, but you’ll most likely have more powerful hardware.

Cloud environments are a fantastic way to provide reproducible build environments, but virtualization requires additional resources on top of the resources exposed to the virtual machine/build environment.

You can try this on your own Mac/PC: running the same compilation directly on your Mac/PC will be faster than doing it in a Virtual Machine.

VM Monitor

You are also able to view your resource usage metrics after a Bitrise build. Now, you can track CPU, memory, disk, and network usage during your builds, giving you deeper insight into performance and resource demands. Read more about it here

With this, you are able to diagnose whether it is a resource or network issue. If it is a resource issue, we suggest upgrading your machine type.

Did this answer your question?