Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8164728

Performance of override clash checks degenerates in some cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • tbd
    • 8u102, 9
    • tools

    Description

      When hierarchies define many many methods with the same name, the performance of the override clash check degenerates:

      http://stackoverflow.com/questions/39111439/java8-slow-compiling-for-interfaces-with-default-methods

      Attached is a simple generator 'gen.sh' - the generator takes an int parameter (the number of overloads in a visitor class) and generates a 'bad' hierarchy.

      If the generator parameter is high enough (2000), javac takes a very long time to compile this example. Most of the time is spent in the routines which check validity of overriding - since most routines prune the checking space simply by filtering by name - which is clearly ineffective if all methods have same names but different signatures.

      Attachments

        Issue Links

          Activity

            People

              vromero Vicente Arturo Romero Zaldivar
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: