JDK-8038492 : javac extremly slow
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2014-03-22
  • Updated: 2014-04-01
  • Resolved: 2014-03-31
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
SunOS dev 5.10 Generic_141445-09 i86pc i386 i86pc


A DESCRIPTION OF THE PROBLEM :
javac compiler extremly slow on some files - ~5-10min per file.

example: bad piece of automatically generated code (Netbeans GUI Builder)
--------------------------------------------------------------------------------------
        jPanelContractLayout.setHorizontalGroup(
            jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelContractLayout.createSequentialGroup()
                .addGap(481, 481, 481)
                .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelStage)
                    .addComponent(jLabelOwner, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelService)
                    .addComponent(jLabelCost))
                .addGap(45, 45, 45)
                .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldCost)
                    .addComponent(jComboBoxService, 0, 189, Short.MAX_VALUE)
                    .addComponent(jComboBoxOwner, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBoxStage, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelContractLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelContractLayout.createSequentialGroup()
                            .addComponent(jLabelAttachFilter)
                            .addGap(593, 593, 593))
                        .addGroup(jPanelContractLayout.createSequentialGroup()
                            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                    .addGap(6, 6, 6)
                                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanelContractLayout.createSequentialGroup()
                                            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addComponent(jComboBoxTags, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jScrollPaneTags, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                                    .addComponent(jButtonDelTag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jScrollPaneGroup, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jButtonDelGroup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                                    .addComponent(jButtonAddTag)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jLabelGroup)
                                                        .addComponent(jComboBoxGroup, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                    .addGap(153, 153, 153)
                                                    .addComponent(jButtonAddGroup))))
                                        .addGroup(jPanelContractLayout.createSequentialGroup()
                                            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabelFieldContract, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabelDescription, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabelTags, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jTextFieldContract, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addComponent(jLabelUserData))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                        .addComponent(jXDatePickerBegin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(jXDatePickerEnd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jSpinnerBegin)
                                                        .addComponent(jSpinnerEnd)))
                                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                                    .addGroup(jPanelContractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jLabelBegin)
                                                        .addComponent(jLabelEnd))
                                                    .addGap(0, 0, Short.MAX_VALUE))))))
                                .addComponent(jScrollPaneAttachFilter, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanelContractLayout.createSequentialGroup()
                                    .addComponent(jCheckBoxApproved)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jCheckBoxSuspended)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jCheckBoxAdvance)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jCheckBoxDone)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jComboBoxWeight, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addContainerGap()))))
        );

--------------------------------------------------------------------------------------

REGRESSION.  Last worked in version 7u51


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Indeed appears to be a duplicate of JDK-8031967.
31-03-2014

Probably duplicate of JDK-8031967, will check.
27-03-2014

the regression if confirmed. It takes only a second to compile the code below with javac from jdk5. And it takes ten times longer with jdk9. $ time ~/java5/jdk1.5.0_55-b03/bin/javac Test.java real 0m0.864s user 0m0.660s sys 0m0.420s $ time ~/java9/jdk1.9.0-b05/bin/javac Test.java real 0m10.092s user 0m13.257s sys 0m3.160s Test.java: public class Test { static Test f() { return new Test(); } static Test f(Test t) { return t; } static void main(String[] args) { f().f(f().f().f(f().f(f().f(f(f().f(f().f(). f(f().f(f(f().f(f().f().f(f().f(f().f(f(f(). f(f().f().f())).f().f(f().f().f())).f(f().f(). f())).f())).f(f().f().f())).f(f().f().f(f(). f().f())).f(f().f().f())).f())).f(f().f(). f())).f().f(f().f().f())).f(f().f().f())).f())); } }
27-03-2014