Rick is a DZone Zone Leader and has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

How Low Can You Go? Examining Java at the Assembler Level

03.31.2008
| 4237 views |
  • submit to reddit

Nope, it's not a Java version of the limbo dance. Kohsuke Kawaguchi has done a clever writeup of a technique he learned for peeking down to the assembler level to see what his Java code gets translated into. He is candid and clear that this is more of an exploration for curiosity's sake than a performance optimizing strategem, and he most definitely is not recommending that you add this to your bag of tricks for everyday problem solving. It's just kinda fun and cool, nothing more.

Read Kohsuke's "Deep Dive" posting

Kohsuke shows a number of source code examples and the corresponding assembler output the compiler generated. He starts with something very trivial just to see what happens, then he progresses into some cases designed to explore advanced output form the compiler. It's a well-considered and intriguing look at something most of us blithely take for granted every day.

What tools have you used to decompile your Java down to bytecode and/or assembler? Have you had any interesting experiences where investigations at that level helped you make significant performance gains ro better comprehend how your high-level code eventually gets turned into something your cpu will understand? How does the prevalence of JITs and optimizing JVMs impact this?