title: Comparison of enums values() method and class.getEnumConstants()
body: <p>I'm trying to compare this two ways to achieving the enums values (with and without reflection). </p>
  
  <p>So this is my test class:</p>
  
  <pre><code>public class ReflectionOnEnumsTests2 {
  
      enum TestEnum { ONE, TWO, THREE; }
  
      public static void main(String[] args) {
          long n = 600_000_000;
          int stub;
  
          //test without Reflection
          long timeStartWithoutReflection = System.currentTimeMillis();
          for (int i = 0; i &lt; n; i++){
              TestEnum[] values = TestEnum.values();
              stub = values.length;
          }
          System.out.println("Time consuming with reflection: " + (System.currentTimeMillis() - timeStartWithoutReflection));
  
          //test Reflection
          long timeStartWithReflection = System.currentTimeMillis();
          for (int i = 0; i &lt; n; i++){
              TestEnum[] values = TestEnum.class.getEnumConstants();
              stub = values.length;
          }
          System.out.println("Time consuming with reflection: " + (System.currentTimeMillis() - timeStartWithReflection));
      }
  }
  </code></pre>
  
  <p>And I'm confused about the test results. There is approximately the same time consuming. I expected that class.getEnumConstants would be much slower than values() method.</p>
  
  <p><strong>Results:</strong>
  <br/>Time consuming with reflection: 6050
  <br/>Time consuming with reflection: 7483</p>
  
  <p><strong>JDK version:</strong>
  1.8.0_60</p>
  
  <p><strong>Question:</strong>
  <br>So why there is no difference in performance?</p>