Glovo Dec 18, 2023

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.

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.

Recent from Glovo

Related Articles