title: slow JDK8 compilation
body: <p>Trying to upgrade to JDK8 on a big project, compilation goes really slow on JDK8 compared to JDK7.</p>
  
  <p>Running the compiler in verbose mode, JDK8 compiler stops at a big generated converter class(Mapping) for entities from server to client.
  The converter methods in several cases call other converter methods from the same Mapping class.</p>
  
  <p>As a workaround tried to split the Mapping file into multiple files. This visibly improved performance when only compiling the Mapping class or it's containing project(projectA). But compile time was very slow for other projects which invoke converter methods from projectA.</p>
  
  <p>Another workaround was to make all convert methods return null, not calling anything else. Again, the performance was good for projectA but not for depending projects.</p>
  
  <p>ProjectA uses generics but since it is compatible with JDK6, which didn't have generalized type inference introduced, maybe it's another JDK8 bug that causes this slowdown.</p>
  
  <p>So possibly out of context but for generalized type inference, some threads like below suggest an upgrade to JDK9. But since it's not yet released, it's not a viable option as upgrade. 
  It'd be ideal if a backport of the fix would be done to JDK8. This was requested in the following StackOverflow thread but no reply from Oracle team yet.</p>
  
  <p><a href="https://stackoverflow.com/questions/34223249/slow-compilation-with-jooq-3-6-plain-sql-and-the-javac-compiler">Slow compilation with jOOQ 3.6+, plain SQL, and the javac compiler</a></p>
  
  <p>I've attached 2 screenshots of how the heap looks in JDK7 vs JDK8. Could this be a cause for the JDK8 slowdown?</p>
  
  <p>Thank you!</p>
  
  <h2>Update 20160314</h2>
  
  <p>The converter methods from Mapping class look like:</p>
  
  <pre><code>public static ResponseItemVO convert (ResponseItem pArg0){
           if(pArg0==null){
               return null;
           }
          ResponseItemVO ret = new ResponseItemVO();
          ret.setErrorDetails(pArg0.getErrorDetails());
          ret.setResult(Mapping.convert(pArg0.getResult()));
          ret.setIdentifier(Mapping.convert(pArg0.getIdentifier()));
          return ret;
      }
  </code></pre>
  
  <p>And the VO looks like:</p>
  
  <pre><code>public class ResponseItemVO extends ResultVO&lt;IdentifierVO, DetailsVO &gt;  {
      public ResponseItemVO() {}
  }
  </code></pre>
  
  <p>JDK7 Heap:
  <a href="https://i.stack.imgur.com/Osndh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Osndh.png" alt="JDK7-heap"></a>
  JDK8 Heap:
  <a href="https://i.stack.imgur.com/zT3Zo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zT3Zo.png" alt="JDK8-heap"></a></p>