Skip to content

Optimize util for calculation year, month, day in Date #2397

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

Merged
merged 14 commits into from
Aug 6, 2022

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Aug 1, 2022

New approach based on novel "Euclidean Affine Functions and Applications to Calendar Algorithms (2021)" implementation and ~1.6x faster than old one.

benchmark & validation on playground

old: 148 ms
new: 94 ms
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO
Copy link
Member

dcodeIO commented Aug 1, 2022

Just to confirm:

The same with old approach: Correct!

ymdFromEpochDays (old) 1/2: 127.400ms
ymdFromEpochDays (new) 1/2: 88.800ms

ymdFromEpochDays (old) 2/2: 136.100ms
ymdFromEpochDays (new) 2/2: 84.700ms

@MaxGraey MaxGraey merged commit f9de611 into AssemblyScript:main Aug 6, 2022
@MaxGraey MaxGraey deleted the opt-date branch August 6, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants