-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance improvements for
Calendar.RecurrenceRule
(#981)
The original implementation of `Calendar.RecurrenceRule` expanded recurrences of dates using the Calendar APIs for matching date components. This would result in multiple sequences for matching date components even when just a single sequence would have sufficed, thus requiring more time and memory to complete enumeration E.g: finding the dates for Thanksgivings (fourth Thursday of each November) took ~4 times as much time using RecurrenceRule when compared to simply matching date components. This commit optimizes how we expand dates for recurrences. Instead of creating a sequence for each value of each component in the recurrence rule, we introduce a new type of sequence closely resembling Calendar.DatesByMatching, but which also allows multiple values per date component.
- Loading branch information
Showing
4 changed files
with
509 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.