-
Notifications
You must be signed in to change notification settings - Fork 153
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
Fewer CalendarDateAdd/DateUntil calls during day-rounding w/ PlainDate #2791
Comments
There's a tradeoff between complexity in figuring out in advance whether you need to Get the method, and unnecessarily Getting it. For sure at one point #2519 was more complicated in this regard than what it currently is. I think it'd be informative if we could see what the effect on the spec text would be. |
In the current code, the place where this decision should be made is very close to After that point in the code, I propose we reassess this issue after further exploring #2792 |
After #2826, we can rewrite this to be an editorial change. At that point, none of the test262 tests should be affected. It looks like the only thing that changed in your diff above was user code calls. |
This is obsoleted by #2925 - since there is no longer a method to Get, I don't think there's anything left to do here. |
To the extent we care about reducing calls to user-code, it's possible to not always
get
the Calendar'sdateAdd
anddateUntil
if you know your not gonna need it for relative-rounding. The case where I've found it's unnecessarily being called is for whenrelativeTo
is a PlainDate and the largest needed unit is <= day. You don't need to involve the calendar for that.I've removed the relevant calls from the test262 tests (might not be comprehensive):
Branch: https://github.com/fullcalendar/test262/tree/temporal-fewer-calls-rounding-day-pd
Diff: tc39/test262@main...fullcalendar:test262:temporal-fewer-calls-rounding-day-pd
Affects more than just Duration::round. Affects the since/until methods too.
The text was updated successfully, but these errors were encountered: