# Benchmark: Kafka builds 6.6x faster on Avrea than GitHub Actions

5m 44s on GitHub Actions. 2m 10s on Avrea without cache. 52 seconds with Gradle's remote cache. That's 2.6x from the hardware, 6.6x once caching kicks in.

[All posts](https://avrea.com/blog)

[Blog](https://avrea.com/blog)
[CI/CD](https://avrea.com/category/ci-cd)

5m 44s on GitHub Actions. 2m 10s on Avrea without cache. 52 seconds with Gradle's remote cache. That's 2.6x from the hardware, 6.6x once caching kicks in.

[Leo Lännenmäki](https://avrea.com/team/leo-lannenmaki)
23 April 2026

Benchmark: Kafka builds 6.6x faster on Avrea than GitHub Actions

On GitHub Actions, a no-cache Kafka build takes 5 minutes 44 seconds. On Avrea, the same build, same 2 vCPU spec: 2 minutes 10 seconds without cache, 52 seconds with Gradle's remote cache.

## Why Kafka

[Apache Kafka](https://github.com/apache/kafka) is a large JVM project: dozens of [Gradle](https://gradle.org/) modules, a long test suite, heavy `javac`. Gradle supports a [build cache](https://docs.gradle.org/current/userguide/build_cache.html) for task outputs.

This combination was a good fit for benchmarking raw runner performance and [Avrea’s Gradle remote caching](https://docs.avrea.com/cache/build-cache/gradle/).

## How we ran the test

We ran `./gradlew assemble` on both sides. Same runner (2 vCPU, 7.8 GiB). [Temurin 21](https://adoptium.net/temurin/releases/?version=21&os=any&arch=any). Same Kafka [commit](https://github.com/apache/kafka/tree/4.2.0).

| | GitHub Actions | Avrea |
| --- | --- | --- |
| Runner label | `ubuntu-24.04` | `avrea-ubuntu-latest-2-vcpu` |
| vCPU | 2 | 2 |
| RAM | 7.8Gi | 7.8Gi |

For the cached run, Gradle’s remote cache was pointed at Avrea’s cache. On the no-cache run, build caching was disabled entirely. The GitHub Actions side had no remote cache hooked up on either run.

Below is a self-contained example workflow of what we are measuring. The Gradle remote cache endpoint is configured automatically on Avrea runners, we only had to flip `--build-cache` in the build. `-PcommitId=benchmark` keeps the git SHA out of task inputs so the cache isn’t invalidated on every commit.

```
name: "Kafka"

on:
  workflow_dispatch:

env:
  PROJECT_REPO: "https://github.com/apache/kafka.git"
  PROJECT_TAG: "4.2.0"
  JAVA_VERSION: "21"

jobs:
  build:
    name: "Build"
    runs-on: avrea-ubuntu-latest-2-vcpu
    steps:
      - name: Clone project
        run: git clone --depth 1 --branch ${{ env.PROJECT_TAG }} ${{ env.PROJECT_REPO }} kafka

      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: ${{ env.JAVA_VERSION }}

      - name: Build
        working-directory: kafka
        run: ./gradlew assemble --build-cache --no-daemon -PcommitId=benchmark
```

## Results

| | GitHub Actions | Avrea | Speedup |
| --- | --- | --- | --- |
| **No cache** | 5m 44s | 2m 10s | **2.6x** |
| **With cache** | n/a | **52.2s** | **6.6x** |

Hardware alone buys 2.6x. Turning on Gradle’s remote cache against Avrea’s cache layer gets the warm number to 52 seconds, for 6.6x total.

## Why it’s faster

### The hardware (the 2.6x)

A no-cache Kafka build spends most of its time in `javac` and incremental class compilation across modules. CPU-bound work.

Avrea’s 2 vCPU runner on dedicated hardware pulls the 2.6x on its own. Same mechanics as every other CPU-bound JVM build.

### The cache (the 6.6x)

Gradle’s remote cache stores task outputs (compiled class files, test results, etc.) keyed by the hash of each task’s inputs. On a cached run, if a task’s inputs match, Gradle pulls the output and skips the task entirely.

Warm hit rate is a low 23%. Kafka’s `assemble` involves generated sources and Scala compilation that consume most other modules’ outputs, which can cause cache invalidations / misses. Improving the build to be more cache friendly could speed it up massively.

That’s why Kafka’s 6.6x is more modest than the 39x on Bazel or the 142x on Next.js in this series of blog posts. 6.6x is still nothing to sneeze at if you get it out-of-the-box without any changes to your workflow.

## Other benchmarks in this series

- [Bazel](https://avrea.com/blog/bazel-ci-benchmark) (39.7x)
- [Linux kernel](https://avrea.com/blog/linux-kernel-ci-benchmark) (68x)
- [Ghostty](https://avrea.com/blog/ghostty-nix-ci-benchmark) (27x)
- [Next.js](https://avrea.com/blog/nextjs-turborepo-ci-benchmark) (142x)
- [RisingWave](https://avrea.com/blog/risingwave-sccache-ci-benchmark) (11.5x)

## What Avrea is

Avrea is [a label swap, not a platform migration](https://avrea.com/ci-runners). `runs-on: avrea-ubuntu-latest` and your Gradle pipeline runs on our hardware.

Every job comes with [CPU and memory at step granularity](https://avrea.com/observability), searchable log history, and SSH into the running VM when you need it. Flaky JVM tests are where the SSH access earns its keep. A test that only fails on the CI box usually needs jstack or a heap dump, which you can only get from the running VM.

Every job runs in an isolated ephemeral VM. [ISO 27001:2022 certified](https://avrea.com/blog/avrea-iso-27001-certified).

[See pricing](https://avrea.com/pricing) or [start free on Avrea →](https://console.avrea.com)

## Explore other articles

- 21 Apr 2026
Benchmark: Bazel builds 39.7x faster on Avrea than GitHub Actions
Read
<https://avrea.com/blog/bazel-ci-benchmark>

- 1 Sept 2026
A guide to GitHub Actions caching
Read
<https://avrea.com/blog/github-actions-cache>

- 10 Jul 2026
The Fastest GitHub Actions Runners in 2026: CPU Benchmarks Are Half the Story
Read
<https://avrea.com/blog/fastest-github-actions-runners>

## Start shipping with Avrea

[Start free](https://console.avrea.com/)
[Talk to an engineer](https://avrea.com/demo)
