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

Cache method calls #176

Open
MetRonnie opened this issue Jul 15, 2020 · 1 comment
Open

Cache method calls #176

MetRonnie opened this issue Jul 15, 2020 · 1 comment
Milestone

Comments

@MetRonnie
Copy link
Contributor

Follow on from #162

Now that the data classes have been made hashable, the next step is to implement some form of lru_cache for some of the methods.

I think we wouldn't implement it for the certain methods whose return value depends on e.g. whether the Duration is in weeks mode or normal mode, such as get_is_in_weeks() or __str__().

@MetRonnie MetRonnie added this to the 2.1 milestone Jul 15, 2020
@MetRonnie MetRonnie modified the milestones: 2.1, 2.2 Mar 30, 2022
@MetRonnie
Copy link
Contributor Author

I think we wouldn't implement it for the certain methods whose return value depends on e.g. whether the Duration is in weeks mode or normal mode, such as get_is_in_weeks() or __str__().

Actually, should be possible to do something like use a private helper method that accepts an arg is_in_weeks and cache that instead, then wrap that helper with the public method

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

No branches or pull requests

1 participant