title: Java comparison speed
body: <p>I was wondering how big is speed difference in object vs. primitive comparison. Imagine this piece of code from linked list implementation, which method is "better" to use?</p>
  
  <pre><code>int size = 0;
  Node head;
  
  boolean isEmpty1() {
     return head == null;
  }
  
  boolean isEmpty2() {
     return size == 0;
  }
  </code></pre>