Skip to content

Build speed improvements #461

@SJrX

Description

@SJrX

Release/CI builds are slow and highly variable (observed 7m–24m). A Develocity build scan of a representative ~7m43s run (https://gradle.com/s/hllckx5e6jnw2) shows where the time goes and what's worth fixing.

Findings from the build scan

  • ~49% of the build is configuration, not compilation/test:
    • Initialization & configuration: 3m49s; Execution: 3m54s.
    • Model configuration 1m40s (IntelliJ Platform plugin building its classpath model) + Configuration resolution 1m18s.
  • The ~948 MiB IntelliJ IDE is re-downloaded every build (ideaIC-2024.2-aarch64.tar.gz, 1 GiB of network total). The build-environment image already warms the Gradle cache, but the baked copy isn't used at runtime — almost certainly because GRADLE_USER_HOME/HOME at runtime differs from where the warm-up wrote it.
  • Remote build cache works well (85% hit, saved ~1m20s) — task outputs are cached; dependencies and configuration are not.
  • Memory is not the bottleneck for the JVM (heap capped at 512 MiB, GC ~5s). The :test swings (1m21s → 6m37s) track CPU contention from co-scheduled pods, not RAM.
  • Two Task.project at execution time deprecations (config-cache blockers).

Planned in the first PR

  • Pin GRADLE_USER_HOME in ci/Build-Environment.Dockerfile so the already-baked IDE/dependency cache is actually used at runtime (hermetic: per-pod COW from the immutable image, distributed via the registry — no shared mutable host state). Expected ~1–1.5 min off every build.
  • Bump the build-environment image to Ubuntu 24.04 (handle the UID 1000 ubuntu default-user collision).
  • Fix the Task.project at execution time deprecations (build warning cleanup; also a prerequisite if configuration cache is ever pursued).

Considered, deferred (want more data first)

  • Node anti-affinity / CPU requests on release pods to spread builds across nodes and stop :test contention. Holding until we capture a scan from a slow run to confirm the contention hypothesis.
  • Configuration cache to reclaim the 1m40s model-configuration. Needs the deprecations fixed and cross-build persistence + a stable checkout path, which conflicts with keeping builds hermetic — not worth it until measured.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions