~/talk

@inline and @specialized: What do they do? Should I be using them?

Talkat Scala Days Berlin 2016 · 2016-06-15..06-17· [scala]
github:cb372
slides:none on file

Explains how Scala and the JVM actually inline and specialize: HotSpot inlines hot small methods so annotating with @inline usually isn’t necessary, and disabling inlining makes the FFT benchmark 3-4x slower. Scala 2.12’s new backend yields about a 10% speedup. @specialized generates multiple versions (up to 10^n classes for n type parameters) to avoid boxing; benchmarks on a bloom filter show little short-term gain but long-term GC and primitive-array locality can matter. Useful tools: JITWatch and compiler flags like -optimize and -Yinline-warnings.

AI-written summary · about

  1. 0:00Introduction to optimization
  2. 3:38Inlining explained
  3. 14:00Inlining in Scala
  4. 19:50Benchmarks for inlining
  5. 24:12Generics and boxing
  6. 30:00Specialization in Scala
  7. 36:40Specialization benchmarks
  8. 40:44Conclusion and final tips
~/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.