Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this context, "compiler" = "JIT", and usually more specifically refers to the server (or final tier) JIT.

Getting solid performance measurements is surprisingly tricky. Take extra care with micro-benchmarks.

Constants

  • Use constants when you can.
  • It's OK to store them in local variables; the SSA representation tends to keep them visible.
  • It's OK to store them in static final fields, too.
  • Static final fields can hold non-primitive, non-string constants.
  • The class of a static final field value is also constant, as is the array length (if it's an array).

...