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

Performance of java.time could be better

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: