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