From Java to Assembly: Down the Rabbit Hole
summary
Walks a simple Java method from javac bytecode through HotSpot JIT into native assembly using javap plus HotSpot flags like printCompilation and printInlining and the external printAssembly plugin. Shows hello world producing thousands of assembly bytes, a tiny 1+1 method optimized away, how final versus lazily initialized finals differ, how synchronization emits a native lock instruction, how string switch becomes a hash lookup then a table switch, how invokedynamic and LambdaMetafactory create lambdas, and how a volatile write in JRuby causes a measurable 2x speedup when removed.
AI-written summary · about
chapters (7)
- 0:00Introduction and speaker background
- 13:21JVM internals primer
- 23:50Hello World bytecode to assembly
- 30:54Final fields and synchronization
- 43:32String switch and lambda expressions
- 58:36Performance insights and takeaways
- 1:01:24Q&A session








