Apple Silicon M1 for Android Builds: Comparing Java 11 vs Java 17 performance

In this blog, we share benchmark results for popular Android projects on M1 comparing Java 11 and Java 17 performance. Learn how to achieve significant Android build time reductions on Apple silicon M1 machines with Java 17.

The Apple silicon M1 stack, since its inception, continues to be groundbreaking. Mobile teams are seeing faster build times for iOS apps on M1 Macs compared to Intel machines. It is also challenging assumptions about mobile speed and performance for app developers, such as the assumption that Android apps should be built on de-factor Linux platforms. So, how do Android projects actually perform on Apple silicon M1 machines? In this blog post, we share some interesting benchmark results that may help your mobile teams optimize Android build times with M1.

The benchmarking was done against popular Android projects: simple Android app, Element Android, DuckDuckGo, and Firefox on different machine types as described here.

Build times comparison

Comparing the build times between Linux machines and Apple M1 machines

Credit usage comparison

Comparing the credit usage between Linux machines and Apple M1 machines

The time diff * and credit diff * are calculated from Linux stack and Apple M1 stack because they give the most valuable insight.

đź’ˇTIP: You can also build Flutter apps on M1 machines to experience faster build times. Learn more about building your Flutter app faster with M1.

Key findings about Java 11 vs Java 17 performance on M1 machines:

  • There’s a huge difference in terms of performance between Java 11 and Java 17 on Apple silicon.
  • Java 11 on M1 is not optimized for Apple silicon as it runs in Rosetta 2, which is subpar.
  • Java 17 offers decent optimization over Java 11, the gain can be observed on both Linux and macOS platforms. Therefore, upgrading to Java 17 is a no-brainer as your projects get built faster for free.
  • Java 17 on M1 gives the best build performance among others.

You may ask why build performance gain is massive on some but insignificant on others. To answer the question: Gradle Profiler was used to run build profiling. We notice projects with big speed gain like Element Android have sequential build tasks including code linting, security scanning, and Gradle tasks. This is quite a pleasant surprise considering how power-efficient Apple M1 is. To contrast, the gain is smaller on projects that are properly structured with parallel Gradle build tasks.

Big speed gain with sequential build tasks
Smaller speed gain with parallel build tasks

At Bitrise, we are seeing more and more customers have switched to Apple silicon M1 machines to build iOS projects with significantly faster build time. Some were able to get build time reduced from 30 mins to 18 mins — or even by over 50% as Reddit, N26, and Cabify achieved after switching to M1 machines.

“Building on M1 machines is essential for us to optimize builds for Apple silicon and run as many tests as we want. We can also easily integrate Bitrise with different platforms and use it in a variety of ways. It just works,” said Matt Robinson, iOS Engineer at Reddit.
‍

This, interestingly enough, opens up new options when considering how Android projects can be built. Depending on how your Android projects are structured, you may see a decrease of 34.5% in build time on Apple silicon — isn’t it fascinating? The saved time could be used for faster iterations, feature planning, investigation, or any meaningful team activities 🙂

Additional resources about building mobile apps on Apple silicon M1

Get Started for free

Start building now, choose a plan later.

Sign Up

Get started for free

Start building now, choose a plan later.