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

Improve ZonedDateTime offset handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b16

      Description

      ZoneOffset::getRules isn't cached, so use heavily relies on escape analysis to elide the allocation. This is fragile optimization-wise, and even when it works we do extra computation that slows things down.

      Adding an abstract ZoneId::getOffset(epochSecond) means that we can avoid querying ZoneOffset::getRules altogether, eliminating the risk we miss escape analysis. Such specialization also helps the ZoneRegion case.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: