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

Reevaluate custom lru_cache decorator #2688

Open
VannTen opened this issue Aug 22, 2022 · 4 comments
Open

Reevaluate custom lru_cache decorator #2688

VannTen opened this issue Aug 22, 2022 · 4 comments
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@VannTen
Copy link
Member

VannTen commented Aug 22, 2022

thoth/storages/graph/postgres.py#L210 contains a implementation of lru_cache
for methods.
This seems like something which should already exists in a library.

Potential candidates (cachetools, functools, methodtools)

Potentially relevant

https://stackoverflow.com/questions/33672412/python-functools-lru-cache-with-instance-methods-release-object
tkem/cachetools#106
python/cpython#64058

Refs

Introduced in commit 06a7722 ("performance reasons")

/kind cleanup
/triage needs-information
/priority backlog

(That's part of my exploration of the storages codebase while trying to fix mypy
errors in #2674, leaving that here for future reference)

@sesheta sesheta added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. triage/needs-information Indicates an issue needs more information in order to work on it. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Aug 22, 2022
@VannTen VannTen changed the title Reevaluate custom lru_cache decorators Reevaluate custom lru_cache decorator Aug 22, 2022
@VannTen
Copy link
Member Author

VannTen commented Aug 30, 2022

/sig stack-guidance

@sesheta sesheta added the sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. label Aug 30, 2022
@mayaCostantini
Copy link
Contributor

I think the goal of this custom decorator was to avoid eventual memory leaks caused by the functools implementation? Why should we replace it with an implementation from a library?

@VannTen
Copy link
Member Author

VannTen commented Aug 31, 2022 via email

@sesheta
Copy link
Member

sesheta commented Mar 22, 2023

Issues needing reporter input close after 60d,

If there is new input, reopen with /reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants