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 Botswana observed holidays #932

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

KJhellico
Copy link
Collaborator

Observed holidays calculation method changed. Here are some performance tests.

def calc_hol1():
    for year in range(1966, 2100):
        hols = Botswana(years=year)

def calc_hol2():
    hols = Botswana(years=range(1966, 2100))

t1 = timeit.timeit(calc_hol1, number=100)
t2 = timeit.timeit(calc_hol2, number=100)
Test Current beta PR
t1 2.740 2.379
t2 39.242 2.157

@coveralls
Copy link

coveralls commented Feb 8, 2023

Coverage Status

Coverage: 100.0%. Remained the same when pulling 14160da on KJhellico:upd-botswana-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

holidays/countries/botswana.py Outdated Show resolved Hide resolved
@arkid15r arkid15r added the ready for beta Ready to merge on beta branch label Feb 8, 2023
Co-authored-by: Arkadii Yakovets <ark@cho.red>
@arkid15r arkid15r changed the title Botswana observed holidays performance optimization Optimize Botswana observed holidays Feb 9, 2023
@arkid15r arkid15r merged commit 421731f 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-botswana-observed branch February 9, 2023 17:33
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