~/talk

Optimizing Scala bytecode for fun and profit

Talkat Scala Days 2026 · 2026-10-12..10-13· [scala, compilers-and-language-design]
links:none on file
slides:none on file

Scala compiler adds a bytecode optimizer that turns high-level code into the same low-level bytecode you’d hand-write (benchmarks show array.map -> while loop equivalence) and yields small wins like ~2–3% faster compilation. It runs a sequence of passes (nullability, unreachable code, inlining) and exposes flags -opt (local optimizations) and -opt-inline (cross-method inlining). Limitations: no incremental compilation, worse debugging, inlining can stale third-party fixes, and JVM safety rules block constructor/ private-field elision (Scala.js can do more).

AI-written summary · about

  1. 0:00Introduction to optimization
  2. 2:22JVM bytecode basics
  3. 4:45Analyzing bytecode examples
  4. 7:12How optimization works
  5. 10:04Deep dive into analysis
  6. 12:36Scala-specific heuristics
  7. 16:05Limitations of inlining
  8. 18:03Risks of using optimizations
  9. 19:55Practical implementation tips
  10. 24:20Conclusion and summary
~/search
type to search 6,518 conferences, 143,918 speakers and 192,133 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.