title: Performance tips questions
body: <pre><code>public void zero() {
      int sum = 0;
      for (int i = 0; i &lt; mArray.length; ++i) {
          sum += mArray[i].mSplat;
      }
  }
  
  public void one() {
      int sum = 0;
      Foo[] localArray = mArray;
      int len = localArray.length;
  
      for (int i = 0; i &lt; len; ++i) {
          sum += localArray[i].mSplat;
      }
  }
  </code></pre>
  
  <p>According to <a href="http://developer.android.com/training/articles/perf-tips.html#Loops" rel="nofollow">Android documentation</a>, in above code, zero is slower. But I don't understand why ? well I haven't learn that much deep but as I know <code>length</code> is a field not method. So when loop retrieves its value, how its different from retrieving from local variable ? and array length is always fixed once initialized. What am I missing ?</p>