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

Improve nextDay implementation #2524

Merged
merged 4 commits into from Jul 23, 2021

Conversation

fturmel
Copy link
Member

@fturmel fturmel commented Jun 19, 2021

This is roughly 50% faster than the current implementation while being simpler. Also see my comment on PR #2522 that implements previousDay.

Copy link
Contributor

@tan75 tan75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that's great!
Thanks for this PR! :) 🥇

@fturmel
Copy link
Member Author

fturmel commented Jun 27, 2021

I realized we don't need to convert the date inside nextDay, which gives us a bit more perf.

Benchmark on local machine:

Version ops/sec
revised PR 2,048,456
initial PR 1,792,947
current 1,306,011

@kossnocorp kossnocorp mentioned this pull request Jul 23, 2021
10 tasks
@kossnocorp kossnocorp merged commit 833cdfa into date-fns:master Jul 23, 2021
@fturmel fturmel deleted the improve-nextDay-implementation branch July 23, 2021 12:45
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

Successfully merging this pull request may close these issues.

None yet

3 participants