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.
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.