Happened to notice that format((Date), "%V") gives identical results to our isoweek, and it's a decent amount faster. Should we just migrate our backend to use base?
e.g.
x = rep(Sys.Date() - 0:5000, 1000)
system.time(out1 <- isoweek(x))
# user system elapsed
# 12.428 21.093 34.376
system.time(out2 <- as.integer(format(x, '%V')))
# user system elapsed
# 4.346 0.221 4.685
identical(out1, out2)
# [1] TRUE
Or should we try and optimize it better?
Happened to notice that
format((Date), "%V")gives identical results to ourisoweek, and it's a decent amount faster. Should we just migrate our backend to use base?e.g.
Or should we try and optimize it better?