title: Big execution time difference between java Lambda vs Anonymous class
body: <p>I was curious about performance of creation of java8 lambda instances against the same anonymous class. (Measurement performed on win32 java build 1.8.0-ea-b106). I've created very simple example and measured if java propose some optimization of <code>new</code> operator while create lambda expression:</p>
  
  <pre><code>static final int MEASURES = 1000000;
  static interface ICallback{
      void payload(int[] a);
  }
  /**
  * force creation of anonymous class many times
  */
  static void measureAnonymousClass(){
      final int arr[] = {0};
      for(int i = 0; i &lt; MEASURES; ++i){
          ICallback clb = new ICallback() {
              @Override
              public void payload(int[] a) {
                  a[0]++;
              }
          };
          clb.payload(arr);
      }
  }
  /**
  * force creation of lambda many times 
  */
  static void measureLambda(){ 
      final int arr[] = {0};
      for(int i = 0; i &lt; MEASURES; ++i){
          ICallback clb = (a2) -&gt; {
              a2[0]++;
          };
          clb.payload(arr);
      }
  }
  </code></pre>
  
  <p>(Full code can be taken there: <a href="http://codepad.org/Iw0mkXhD">http://codepad.org/Iw0mkXhD</a>) The result is rather predictable - lambda wins 2 times. </p>
  
  <p>But really little shift to make <a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29">closure</a> shows very bad time for lambda. Anonymous class wins 10 times! 
  So now anonymous class looks like:</p>
  
  <pre><code>ICallback clb = new ICallback() {
          @Override
          public void payload() {
              arr[0]++;
          }
      };
  </code></pre>
  
  <p>And lambda does as follow:</p>
  
  <pre><code>ICallback clb = () -&gt; {
              arr[0]++;
          };
  </code></pre>
  
  <p>(Full code can be taken there: <a href="http://codepad.org/XYd9Umty">http://codepad.org/XYd9Umty</a> )
  Can anybody explain me why exists so big (bad) difference in handling of closure?</p>