-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
C-calendarComponent: CalendarsComponent: CalendarsU-temporalUser: Temporal and V8User: Temporal and V8good first issueGood for newcomersGood for newcomers
Milestone
Description
The specification algorithm is designed to be readable, but it is not fast, because it adds one month and one year at a time. There are two cases that can be optimized:
- Adding 1000 months to a date requires running a loop for each year, and adding the number of days in each year until the month is in-range. For calendars with a fixed number of months per year, this is trivial to fast-path. For calendars with a variable number of months per year, this can likely still be fast-pathed, but more care needs to be taken.
- Adding 1000 days to a date requires running a loop for each month, and adding the number of days in each month until the day is in-range. No calendar has a fixed number of days per month. But, a fast-path could be to add a years-worth of days all at once, and then to add multiple years at once, being careful about leap years, of course.
Metadata
Metadata
Assignees
Labels
C-calendarComponent: CalendarsComponent: CalendarsU-temporalUser: Temporal and V8User: Temporal and V8good first issueGood for newcomersGood for newcomers