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

Avoid eagerly creating JCDiagnostic for CompletionFailures

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b15

      Description

      When javac resolves a file with many yet-to-be generated types, a CompletionFailure is created while trying to resolve each one. In order to create those objects, a new JCDiagnostic is also created. In profiles of large compilations with annotation processing, I've seen the JCDiagnostic creation continually show up as taking anywhere from 700ms - 3s depending on the compilation/structure of the generated code. In the case of annotation processing, these diagnostics may never be reported to the messager if a later round generates the types.

      I propose that instead of taking a JCDiagnostic, we change CompletionFailure to take a Supplier<JCDiagnostic>, similar to the approach taken in JDK-8215368.

        Attachments

          Activity

            People

            Assignee:
            ronsh Ron Shapiro
            Reporter:
            ronsh Ron Shapiro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: