Skip to main content
Uber logo

Schedule rides in advance

Reserve a rideReserve a ride

Schedule rides in advance

Reserve a rideReserve a ride
Mobile, Engineering

Measuring Kotlin Build Performance at Uber

April 30, 2019 / Global
Featured image for Measuring Kotlin Build Performance at Uber
Table 1: Our Build Performance Matrix included 13 different design scenarios, leading to hundreds of diverse builds.
Figure 1. Uber’s project generation workflow for materializing projects from Thrift files leverages the Buck build tool.
Figure 2. Although diverse, the maximum project file size for our experiment was around 500 files. For this feature, we might improve our data set to account for bigger projects. The available projects, however, are enough for the analysis results not to be biased by any fixed possible variant (in this case, the total number of files).
Figure 3. Our experiments’ benchmark workflow CI was composed of the CI job itself, a modelgen pipeline, collecting and consolidating build data, and committing the experiment result file to a Git repository.
Figure 4. To post the benchmark results to the cloud in our local workflow, we clone the repository in which all the results are hosted, transform them into a previously defined schema, and then post that final data to ElasticSearch. This is mainly done in order to overcome constraints in our CI environment and make it easier to share the results.
Figure 5: For this experiment, we measured the total compilation time (kontlinc plus javac) per configuration type (see Table 1). The Y-axis represents the compilation time of each combination, and each bar represents a different configuration.
Figures 6a and 6b: The consistency of javac and kotlinc times, in seconds, for each matrix line, prove that our experiment environment was well-controlled.
Figure 7: For this experiment, we measured the average number of code, blank, and comment lines per language per project and determined that for functionally-equivalent code, Kotlin projects are around 40 percent smaller than Java projects.
Figure 9: During our experiment, we measured total compilation time (javac plus kotlinc) growth based on project size. In this graph, the Y-axis represents the total compilation time, on average, and the X-axis represents the size of project based on the total number of materialized files (in other words, files that were generated by Kapt or Apt are not counted here).
Figure 10: Error Prone checkers triggered during the months of March and April of 2019 highlighted where our overhead likely came from during some of our experiments.
Edgar Fernandes

Edgar Fernandes

Edgar Fernandes is a senior software engineer on Uber's Amsterdam Mobile Developer Experience team.

Thales Machado

Thales Machado

Thales Machado is a senior software engineer on Uber's Amsterdam Mobile Developer Experience team.

Tho Nguyen

Tho Nguyen

Tho Nguyen is a senior software engineer on Uber's Amsterdam Mobile Developer Experience team.

Zac Sweers

Zac Sweers

Zac Sweers is a senior software engineer on Uber's Mobile Foundations team.

Posted by Edgar Fernandes, Thales Machado, Tho Nguyen, Zac Sweers