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

Performance of java.time could be better

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • 8
    • core-libs
    • b20

    Backports

      Description

        In the java.time library three performance improvements can be noted:

        1) In the Parsed class crossCheck() method, an exception is used for control flow. A typical parse containing an offset will trigger the exception throw/catch three times, slowing the parse.

        2) In the from() method of ZonedDateTime and OffsetDateTime, exception throwing is used for control flow where an if statement would be more performant.

        3) In the query() method of Instant and ZonedDateTime, the seven query types are not all handled, causing the slower default implementations to be called.

        These are essentially bugs in the implementation. There is no externally observable change other than better performance.

        Attachments

          Issue Links

            Activity

              People

                rriggs Roger Riggs
                scolebourne Stephen Colebourne
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: