-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Improve time-of-day subsetting performance #193
Comments
All valid xts indices must be ordered, so checking for an unordered index is nice defensive programming, but the user should expect an error if they are constructing an index (e.g. in C/C++) which is not ordered. Negative values may be avoided by an appropriate choice of origin. For intraday data, one should probably use As for NA or out of bounds data, I think this could be contained in a try block, and we could handle any errors in the catch. All these checks in the existing code seem nice, but none of them seem strictly necessary. A well-constructed object should not have these problems, except possibly duplicated indices. The normal constructors will prevent the rest. |
@silentbits All your questions point to the |
Need unit tests around daylight saving time. This should include DST starting and ending inside the desired interval, as well as when the interval contains a time affected by DST. For example, the interval is something like |
Did the improved sub-setting ever get released? |
@ckatsulis No, and in general, an issue is not released if was opened prior to a release and remains open after the release. I also try to ensure commits reference the issues they address, and GitHub will display those commits inline with issue comments. No work has been done on this issue, so there are no commits that reference it. You (or anyone else) could help get this issue included in the next release by providing some unit test cases. I'm very reluctant to release code changes that are not accompanied by relevant tests. That is especially true in this case, since it is essentially a re-write of the existing functionality. |
This restores the behavior that existed before the prior commit to improve performance. Yes, this actually makes sense and is useful for financial markets. For example, some futures markets open at 18:00 and close at 16:00 the next day. See #193.
@ckatsulis This is now in master. I'd appreciate it if you could use this development version and provide any feedback before the next release. |
A StackOverflow user wrote a function that is 200x faster than xts' current time-of-day subset implementation. Included below, byte-compiled, and in case the StackOverflow page is not available sometime in the future.
And the relevant benchmark:
The text was updated successfully, but these errors were encountered: