~/talk

Java: Reflection is dead, long live annotation processing!

Talkat jPrime 2024 · 2024-05-28..05-29· [java]
links:none on file
slides:none on file

Claim: replace runtime reflection with compile‑time annotation processing to avoid runtime overhead and make generated code debuggable. Evidence: a microbenchmark shows reflective instantiation is 6–10× slower than direct construction. Tools used: JSR-269 annotation processors invoked by javac, the Processing/Filer/TypeElement APIs, optional JavaPoet, plus a homemade bytecode name-changer and compiler plugins for tasks not possible in processors. Built: a factory generator that writes source switch cases, then renames generated class files to original names — brittle but effective.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 2:16Reflection controversy and talk agenda
  3. 4:41Replacing conditionals with polymorphism
  4. 8:57Reflection performance costs
  5. 15:07Annotation processing fundamentals
  6. 23:45Factory pattern with annotation processing
  7. 31:02Handling generated class visibility
  8. 33:53Bytecode manipulation challenges
  9. 40:43Compiler plugins alternative
  10. 42:51Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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.