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

Сalculation speed up for the Gregorian calendar #5849

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Nikita-str
Copy link

@Nikita-str Nikita-str commented Nov 21, 2024

Solving #5562 by implementing algo from the article for the Gregorian calendar.
The article: "Euclidean Affine Functions and Applications to Calendar Algorithms" by Cassio Neri & Lorenz Schneider (Feb. 2021).

Draft PR:

  • As I understand there is many places where parts of the logic is used and I only change the main file.
  • Also need to run/writes benchmarks in the repo (by now, I run benches only in local pseudo repo where I test the algo).
  • Also with the same logic can be speeded up the Julian calendar.
  • Tests: not only test the same value as prev algos

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2024

CLA assistant check
All committers have signed the CLA.

Performance of new version is much better(~60%) at the end of a year, ~25% better in avg, and the same at the start of a year.
Performance of new version is much better(~400%) (at least on my CPU).
Seems like indexing (in prev algo) is pretty slow.
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