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

Optimize Ukraine observed holidays #934

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

KJhellico
Copy link
Collaborator

Performance tests:

country = "UA"
START_YEAR = 1917
END_YEAR = 2099

def calc_hol1():
    for year in range(START_YEAR, END_YEAR + 1):
        hols = holidays.country_holidays(country, years=year)

def calc_hol2():
    hols = holidays.country_holidays(country, years=range(START_YEAR, END_YEAR + 1))

t1 = timeit.timeit(calc_hol1, number=100)
t2 = timeit.timeit(calc_hol2, number=100)
Test Current beta PR
t1 2.290 2.219
t2 19.376 1.925

@coveralls
Copy link

Coverage Status

Coverage: 100.0%. Remained the same when pulling 1e2414b on KJhellico:upd-ukraine-observed into 719c267 on dr-prodigy:beta.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

test/countries/test_ukraine.py Show resolved Hide resolved
@arkid15r arkid15r added the ready for beta Ready to merge on beta branch label Feb 9, 2023
@arkid15r arkid15r changed the title Ukraine observed holidays performance optimization Optimize Ukraine observed holidays Feb 9, 2023
@arkid15r arkid15r merged commit d471e4d into vacanza:beta Feb 9, 2023
@arkid15r arkid15r removed the ready for beta Ready to merge on beta branch label Feb 9, 2023
@KJhellico KJhellico deleted the upd-ukraine-observed branch February 9, 2023 17:34
This was referenced Feb 20, 2023
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.

3 participants