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

Improve ZonedDateTime offset handling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • None
    • core-libs
    • None
    • b16

      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.

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

              Created:
              Updated:
              Resolved: