-
Notifications
You must be signed in to change notification settings - Fork 254
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
perf: return least complex marker when building intersection #821
Conversation
Reviewer's Guide by SourceryThis pull request optimizes marker intersection performance by returning the least complex marker representation. This addresses performance regressions observed when intersecting markers. Class diagram for marker hierarchy and operationsclassDiagram
class BaseMarker {
+complexity
+exclude(marker_name)
+only(marker_names)
}
class MultiMarker {
+markers
+exclude(marker_name)
+only(marker_names)
}
class MarkerUnion {
+markers
+exclude(marker_name)
+only(marker_names)
}
BaseMarker <|-- MultiMarker
BaseMarker <|-- MarkerUnion
note for MultiMarker "Modified exclude() to use intersection"
note for MarkerUnion "Modified exclude() to use union"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @radoering - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @radoering - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
cfb877c
to
f00b7cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo.
This is analogous to what we do when building the union. Although this means extra work, it pays off if the resulting marker is used in another marker operation.
Otherwise, the expectations in the export tests had to be changed due to the previous commit.
f00b7cb
to
d5f6120
Compare
This is analogous to what we do when building the union. Although this means extra work, it pays off if the resulting marker is used in another marker operation.
Relates to: python-poetry/poetry#9956
The downstream failures are caused by cosmetic changes. The tests are fixed in python-poetry/poetry#10077. We should probably merge this PR with failing downstream tests and switch from the released poetry-core version to the main branch afterwards.
After the simplified repro reported in python-poetry/poetry#9956 (comment) is almost as fast as before (see #818), I took a look at the example from python-poetry/poetry#9956 (comment), which is still significantly slower. With this PR, it is about as fast as before:
Summary by Sourcery
Optimize marker intersection performance by returning the least complex marker representation. This addresses performance regressions observed when intersecting markers.
Bug Fixes:
Tests:
Summary by Sourcery
Optimize marker intersection performance by returning the least complex marker representation.
Bug Fixes:
Tests: