Skip to content

direct access for performance and typechecking#5805

Merged
neersighted merged 2 commits into
python-poetry:masterfrom
dimbleby:direct-access
Jul 25, 2022
Merged

direct access for performance and typechecking#5805
neersighted merged 2 commits into
python-poetry:masterfrom
dimbleby:direct-access

Conversation

@dimbleby
Copy link
Copy Markdown
Contributor

@dimbleby dimbleby commented Jun 8, 2022

Revisiting #2149, which seems to have stalled or maybe got into some merge conflict horror.

As it goes, I can't reproduce anything like the performance gains reported over there, which is a shame because I'd really have liked to!

  • in the example of the original report, resolution is simply much faster in the first place. It's hard to tell whether that's because poetry has changed, or because the web of dependencies has changed such that this particular example is easier to resolve. I am seeing times nearer 2 seconds than 200 seconds.
  • in some examples I do have with slower resolves, I just don't see meaningful gains.

However: this surely can't hurt performance...

Even if this doesn't turn out to be a big performance win though, I think that it is still good discipline. In particular, removing the __setattr__() and __getattr_() tightens up the typechecking: we no longer have to wait to runtime to find that we have gone wrong.

Actually I'd have been a little scared to make this change without good mypy coverage: but that and the test suite makes me pretty confident that this is safe.

Comment thread src/poetry/puzzle/provider.py Outdated
Comment thread src/poetry/puzzle/provider.py Outdated
@dimbleby
Copy link
Copy Markdown
Contributor Author

just doing a review of my open MRs and I think this one is good to merge. (But also it's not urgent; it can wait until after 1.2.0)

@neersighted neersighted merged commit bf0dbc0 into python-poetry:master Jul 25, 2022
@dimbleby dimbleby deleted the direct-access branch July 25, 2022 14:08
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants