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

Investigate use of lru_cache on methods #1344

Closed
DanielNoord opened this issue Jan 13, 2022 · 1 comment
Closed

Investigate use of lru_cache on methods #1344

DanielNoord opened this issue Jan 13, 2022 · 1 comment
Assignees
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow topic-performance

Comments

@DanielNoord
Copy link
Collaborator

Problem

I stumbled upon this video which explains problems with using lru_cache on methods as it leaks self. I haven't watched the full video yet but watched the previous video and saw the PR at pytest here: pytest-dev/pytest#9148

This is something we're doing ourselves as well and could be a potential source of memory leaks and other problems. I think this warrants an investigation and probably a refactor.

/CC @keichi As your PR #1242 also decorates methods, they might also be affected by this. Note that I haven't watched the full video yet so I don't know the exact implications but this is worthwhile to investigate.

@DanielNoord DanielNoord added topic-performance Maintenance Discussion or action around maintaining astroid or the dev workflow labels Jan 13, 2022
@DanielNoord DanielNoord self-assigned this Jan 13, 2022
@jacobtylerwalls
Copy link
Member

We looked into this in #1521 and decided the two remaining uses of @lru_cache on methods were fine because of the extremely low cache sizes, 128 and ~13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow topic-performance
Projects
None yet
Development

No branches or pull requests

2 participants