Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compilation and Bytecode

 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any performance difference on the bytecode generated using the same source on different compilers? Are the comments on the source added into the compiled file? Thanks.
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure about the first question. But no, the comments would not be found in byte code.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there any performance difference on the bytecode generated using the same source on different compilers?

No, not really. In most JVMs, bytecode is further translated into machine code by a JIT or the HoptSpot engine (in Sun's JVMs.) These machine-code translators do further optimization, so the best performance generally comes from the most "typical" code. Most byte-compilers simply try to emit plain, ordinary code which is similar to what javac produces, to make the work of the JIT or HotSpot compiler easier.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic