Over a million developers have joined DZone.

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

DZone's Guide to

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

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

[img_assist|nid=2098|title=|desc=|link=none|align=right|width=200|height=190]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?

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}