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

Memoize equality for CoarsenedTarget(s) to avoid exponential runtime in check. #15277

Merged
merged 1 commit into from Apr 29, 2022

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Apr 29, 2022

#15141 gave CoarsenedTarget new usecases, which unfortunately exposed a case where check would re-run in exponential runtime due to not having implemented a TODO about __eq__ using a memoized graph walk.

[ci skip-rust]
[ci skip-build-wheels]

@stuhood stuhood added needs-cherrypick category:bugfix Bug fixes for released features labels Apr 29, 2022
@stuhood stuhood added this to the 2.11.x milestone Apr 29, 2022
@stuhood stuhood changed the title Memoize equality for CoarsenedTarget(s) to avoid exponential runtime. Memoize equality for CoarsenedTarget(s) to avoid exponential runtime in check. Apr 29, 2022
@stuhood stuhood enabled auto-merge (squash) April 29, 2022 00:22
@stuhood stuhood changed the title Memoize equality for CoarsenedTarget(s) to avoid exponential runtime in check. Memoize equality for CoarsenedTarget(s) to avoid exponential runtime in check. Apr 29, 2022
self._hashcode == other._hashcode
and self.members == other.members
# TODO: Use a recursive memoized __eq__ if this ever shows up in profiles.
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Narrator: "It did."

[ci skip-rust]

[ci skip-build-wheels]
@stuhood stuhood merged commit e7c6095 into pantsbuild:main Apr 29, 2022
@stuhood stuhood deleted the stuhood/ct-equals branch April 29, 2022 03:14
stuhood added a commit to stuhood/pants that referenced this pull request Apr 29, 2022
…e in `check`. (pantsbuild#15277)

pantsbuild#15141 gave `CoarsenedTarget` new usecases, which unfortunately exposed a case where `check` would re-run in exponential runtime due to not having implemented a TODO about `__eq__` using a memoized graph walk.

[ci skip-rust]
[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Apr 29, 2022
…e in `check`. (Cherry-pick of #15277) (#15278)

#15141 gave `CoarsenedTarget` new usecases, which unfortunately exposed a case where `check` would re-run in exponential runtime due to not having implemented a TODO about `__eq__` using a memoized graph walk.

[ci skip-rust]
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano removed this from the 2.11.x milestone May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants