Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider faster implementations of accessor functions #324

Closed
hadley opened this issue May 13, 2015 · 2 comments
Closed

Consider faster implementations of accessor functions #324

hadley opened this issue May 13, 2015 · 2 comments

Comments

@hadley
Copy link
Member

hadley commented May 13, 2015

I think many of the access functions (e.g. year(), yday()) could be reimplemented much more efficiently by taking advantage of the fact that it's easy to determine year offsets with a lookup table (e.g. https://github.com/hadley/readr/blob/master/src/DateTime.h). My intuition is that plus some modular arithmetic should be orders of magnitude faster than using as.POSIXlt

@vspinu
Copy link
Member

vspinu commented May 13, 2015

My intuition is that plus some modular arithmetic should be orders of magnitude faster than using as.POSIXlt

It will probably work for all units in UTC. I guess it could straightforwardly work for year, month and day irrespectively of the timezone. For smaller units it's tricky.

Our real problem is with the other way around -as.POSIXct - which is crucial for all updates. It's 5x slower than as.POIXlt.

@hadley
Copy link
Member Author

hadley commented Aug 18, 2016

No longer think that this is that important (or that easy)

@hadley hadley closed this as completed Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants