Glovo alexxozo

How Glovo Slashes Lead Times by 30%: The Impact of Using Explicit Types in JVM

Original post Slashing Lead Times by 30%: The Impact of Using Explicit Types in JVM

Article Summary

alexxozo from Glovo's engineering team discovered that a single line of code change slashed their build time by 30%. The culprit? Java's type inference struggling with large Map definitions.

Glovo's feed service team faced a critical bottleneck: 35-minute builds were killing their ability to experiment and respond to incidents quickly. After migrating from Jenkins to GitHub Actions and optimizing tests, compilation time remained painfully slow. The breakthrough came from diving deep into Gradle's verbose logging.

Key Takeaways

Critical Insight

Adding Map.<String, String>ofEntries instead of Map.ofEntries reduced compilation from 35 to 25 minutes by eliminating expensive type inference on large static data structures.

Continue reading

What This Article Covers

Problem

When Glovo moved from Jenkins to GitHub Actions, their microservice builds started taking 35 minutes and kept running out of memory. GitHub Actions had tighter resource limits, which exposed problems in their integration tests. These tests were consuming way too much memory.

Solution

The team made several changes to their Gradle setup. They turned on fork mode, incremental compilation, and parallel task execution. They also found tests that were missing Spring profiles and removed unit tests that were incorrectly extending integration base classes.

Impact

The CI pipeline went from 36 minutes down to about 25 minutes. This meant the team could experiment with new features faster and respond to incidents more quickly for Glovo's feed service.

The article reveals the exact Gradle configuration tweaks and JavaCompile options that exposed the bottleneck, plus why the JVM compiler struggles with certain code patterns.

This page summarizes “Slashing Lead Times by 30%: The Impact of Using Explicit Types in JVM” by Glovo, published Dec 18, 2023. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for Android

Browse all AI tools →