FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Just use base functionality for `isoweek`? · Issue #5111 · Rdatatable/data.table · GitHub

Just use base functionality for isoweek? #5111

Description

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL