~/talk

How to make Kotlin compile 2x faster?

Talkat droidcon San Francisco 2024 · 2024-06-06..06-07· [kotlin]
links:none on file
slides:none on file

Aiming to halve Kotlin compile time on a huge monorepo, the team uses Gradle + Kotlin compiler tweaks: remove unused dependencies and split modules to raise parallelism, run ABI/dependency analysis, and move plugins into minimal scopes. They build and store Kotlin incremental files (cache.db, lastBuild.db) alongside bytecode in a remote cache and implement baseline cache so the server returns the closest cache plus dirty-file diffs, enabling cache to incremental resumes. Combined with class path isolation, Kotlin compile cache hits jump from ~30% to ~80–90% and average build time drops ~70%, delivering the claimed 2x speedup.

AI-written summary · about

  1. 0:00Introduction
  2. 4:01Build speed at TikTok
  3. 10:25Unused dependency removal
  4. 16:51Project structure design
  5. 23:18Class path isolation
  6. 27:14Cache and incremental
  7. 34:50Results and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.