The performance of window_idx() should be improved if youunclass() on the POSIXct vectors before calling findInterval(). The anyNA() and is.unsorted() calls in findInterval() are faster on vectors of numeric than vectors of POSIXct due to the ALTREP support for numeric vectors.
Description
The performance of
window_idx()
should be improved if youunclass()
on the POSIXct vectors before callingfindInterval()
. TheanyNA()
andis.unsorted()
calls infindInterval()
are faster on vectors of numeric than vectors of POSIXct due to the ALTREP support for numeric vectors.Line 284 of xts.methods.R:
Expected behavior
No change in output
Minimal, reproducible example