Skip to content

Use @lru_cache(maxsize=None) when appropriate - #1746

Merged
matthiask merged 1 commit into
django-commons:mainfrom
living180:lru_cache
Mar 6, 2023
Merged

Use @lru_cache(maxsize=None) when appropriate#1746
matthiask merged 1 commit into
django-commons:mainfrom
living180:lru_cache

Conversation

@living180

Copy link
Copy Markdown
Contributor

For functions which do not take arguments, there is no need to limit the maximum size of the cache used by @lru_cache (since it will never have more than one entry). By using @lru_cache(maxsize=None), a simpler, faster cache implementation is used internally.

For functions which do not take arguments, there is no need to limit the
maximum size of the cache used by @lru_cache (since it will never have
more than one entry).  By using @lru_cache(maxsize=None), a simpler,
faster cache implementation is used internally.
@matthiask
matthiask merged commit 5b4450a into django-commons:main Mar 6, 2023
@matthiask

Copy link
Copy Markdown
Member

Thanks!

@living180
living180 deleted the lru_cache branch April 15, 2023 08:54
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.

3 participants