Re: RFR: 8318051: Duration.between uses exceptions for control flow

2023-10-24 Thread Roger Riggs
On Mon, 23 Oct 2023 17:33:48 GMT, Eamonn McManus wrote: > The existing logic uses nanosecond arithmetic to compute Duration.between. > Since that can overflow for durations greater than 292 years, it has a > try/catch that falls back to computing the seconds part and adjusting that > for nanos

Re: RFR: 8318051: Duration.between uses exceptions for control flow

2023-10-24 Thread Eamonn McManus
On Mon, 23 Oct 2023 17:33:48 GMT, Eamonn McManus wrote: > The existing logic uses nanosecond arithmetic to compute Duration.between. > Since that can overflow for durations greater than 292 years, it has a > try/catch that falls back to computing the seconds part and adjusting that > for nanos

Re: RFR: 8318051: Duration.between uses exceptions for control flow

2023-10-24 Thread Roger Riggs
On Mon, 23 Oct 2023 17:33:48 GMT, Eamonn McManus wrote: > The existing logic uses nanosecond arithmetic to compute Duration.between. > Since that can overflow for durations greater than 292 years, it has a > try/catch that falls back to computing the seconds part and adjusting that > for nanos

RFR: 8318051: Duration.between uses exceptions for control flow

2023-10-23 Thread Eamonn McManus
The existing logic uses nanosecond arithmetic to compute Duration.between. Since that can overflow for durations greater than 292 years, it has a try/catch that falls back to computing the seconds part and adjusting that for nanoseconds. However, exception handling is typically very expensive, s