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

Update use cases of fuctools.lru_cache to use LruCache #1449

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Oct 7, 2024

To address potential memory leaks, PR updates use cases of functools.lru_cache to use LruCache.

@cla-bot cla-bot bot added the cla:yes label Oct 7, 2024
@plypaul plypaul marked this pull request as ready for review October 7, 2024 14:14
@plypaul plypaul force-pushed the p--short-term-perf--23 branch from 0c254f2 to 33b1a10 Compare October 7, 2024 14:15
@plypaul plypaul force-pushed the p--short-term-perf--24 branch from bfebff1 to c63aa58 Compare October 7, 2024 14:15
if result is not None:
return result

result = self._linkable_spec_resolver.get_linkable_elements_for_metrics(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue in the linkable spec resolver related to this, and I want to make sure we're not encountering it here. get_linkable_elements_for_metrics() returns a different result than get_linkable_elements_for_measures(). But the measures method is the one that is actually used in queries to resolve specs for metrics. the metrics method is only used in metadata queries (i.e., list dimensions). There are minor differences between the two results, the main one I can think of being the date part restriction for cumulative metrics. I haven't had time to dig into that bug but we should make sure we're using the correct logic for this call.
It probably doesn't impact this logic, but would be good to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this change should not be affected by that issue.

@plypaul plypaul force-pushed the p--short-term-perf--23 branch from 33b1a10 to 8d704e1 Compare October 10, 2024 16:34
@plypaul plypaul force-pushed the p--short-term-perf--24 branch from c63aa58 to 3db62a7 Compare October 10, 2024 16:34
@plypaul plypaul force-pushed the p--short-term-perf--23 branch 2 times, most recently from 8829989 to a3d5d63 Compare October 10, 2024 17:42
@plypaul plypaul force-pushed the p--short-term-perf--24 branch from 3db62a7 to 4ecc0f6 Compare October 10, 2024 17:42
Base automatically changed from p--short-term-perf--23 to main October 11, 2024 14:30
@plypaul plypaul force-pushed the p--short-term-perf--24 branch from 4ecc0f6 to b63c92e Compare October 11, 2024 14:32
@plypaul plypaul merged commit 15a6ae7 into main Oct 14, 2024
11 checks passed
@plypaul plypaul deleted the p--short-term-perf--24 branch October 14, 2024 17:06
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.

2 participants