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

Implement next_date and prev_date #33

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Implement next_date and prev_date #33

merged 1 commit into from
Oct 31, 2023

Conversation

nakedible
Copy link
Owner

@nakedible nakedible commented Oct 14, 2023

Add next_date and prev_date algorithms, tests, documentation and benchmarks. Implementation is original but not novel.

@cassioneri
Copy link
Collaborator

Have you tried: rd_to_date(date_to_rd(y, m, d) + 1) and rd_to_date(date_to_rd(y, m, d) - 1)? I'm curious. 🙂

@nakedible nakedible force-pushed the next-prev-date branch 2 times, most recently from c2b0867 to 67a6fe8 Compare October 14, 2023 18:51
@nakedible
Copy link
Owner Author

nakedible commented Oct 14, 2023

Have you tried: rd_to_date(date_to_rd(y, m, d) + 1) and rd_to_date(date_to_rd(y, m, d) - 1)? I'm curious. 🙂

Yes, I did ;-)

compare_next_date/datealgo
                        time:   [1.0013 ns 1.0091 ns 1.0174 ns]
compare_next_date/datealgo_alt
                        time:   [6.3359 ns 6.3447 ns 6.3541 ns]
compare_next_date/chrono
                        time:   [2.0256 ns 2.0483 ns 2.0710 ns]
compare_next_date/time  time:   [2.1835 ns 2.1888 ns 2.1947 ns]

compare_prev_date/datealgo
                        time:   [963.39 ps 970.16 ps 977.29 ps]
compare_prev_date/datealgo_alt
                        time:   [5.9197 ns 5.9297 ns 5.9404 ns]
compare_prev_date/chrono
                        time:   [2.2530 ns 2.2700 ns 2.2873 ns]
compare_prev_date/time  time:   [2.1307 ns 2.1463 ns 2.1617 ns]

https://github.com/nakedible/datealgo-rs/pull/33/files#diff-8a5132136b7f8e663ead5995baf0fcebd03e79aca4d81f823bad1e403d391bf5R146-R156

@nakedible nakedible marked this pull request as ready for review October 14, 2023 19:00
@nakedible nakedible merged commit 7df2164 into master Oct 31, 2023
1 check passed
@nakedible nakedible deleted the next-prev-date branch October 31, 2023 09:24
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.

2 participants