SYSTEM Cited by 1 source
Turbine (Java header compiler)¶
Turbine is Google's open-source header compiler for Java: instead of producing full bytecode, it quickly produces the headers (type signatures / API surface) of Java sources — the ABI needed to compile things that depend on them. It is used in Bazel-style builds to compile against dependency headers without waiting for full compilation. In Metals v2 a modified Turbine is used to make Java code intelligence scale. (Source: sources/2026-08-11-databricks-open-sourcing-metals-v2)
Why Metals v2 needs it¶
Metals v2 implements the Java LSP surface directly on javac APIs (rather than
reusing build-centric JDT- or NetBeans-based servers). The main scalability
problem there is files that trigger pathological performance in the javac
"enter" phase by transitively importing millions of lines of code at the
symbol-outline layer.
Metals v2 fixes this with a javaSymbolLoader: "turbine-classpath" mode
(enabled by default), using a modified Turbine that produces a repository
classpath usable in an IDE setting — including graceful handling of naming
resolution errors (important for partially broken, actively edited code).
The throughput that makes it work¶
Turbine processes close to one million lines of Java per second on a single
thread. That lets Metals recompile the whole Java codebase on a regular
interval, keeping nearly all cross-file symbols on the classpath instead
of the sourcepath. As a result the javac "analyze" phase can run close to its
practical interactive limit — almost 100k lines/sec in Databricks'
benchmarks — because it no longer re-enters huge transitive symbol outlines per
file.
This is the Java-side counterpart to the Scala presentation compiler's outline mode: both cut symbol-outline cost so interactive type-checking stays fast at monorepo scale.
Seen in¶
Related¶
- systems/metals-v2
- presentation-compiler
- systems/bazel