Skip to content

Comments

performance: fix a performance regression introduced in #402#582

Merged
radoering merged 1 commit intopython-poetry:mainfrom
radoering:pypa-packaging-compliance-performance
May 12, 2023
Merged

performance: fix a performance regression introduced in #402#582
radoering merged 1 commit intopython-poetry:mainfrom
radoering:pypa-packaging-compliance-performance

Conversation

@radoering
Copy link
Member

Fixes a perfomance regression introduced in #402 by applying cached_property to certain properties

cached_property is available since Python 3.8. There is a package named backports.cached-property, which makes the decorator available in Python 3.7. However, I don't want to add a new vendored dependency since we will drop Python 3.7 support anyway in the near future. We could introduce a restricted dependency on backports.cached-property like in poetry or just accept the performance regression for Python 3.7. I have chosen the latter but do not have strong feelings about it.

In the following table you can see the cumtime of relevant calls (in seconds) from profiling different variants for a sample project

variant excludes_single_version() VersionUnion.allows() VersionRangeConstraint.allowed_min
poetry master 2.2 0.3 -
poetry master with poetry-core master 15.3 12.4 7.7
poetry master with this PR 1.0 0.65 0.1

@radoering radoering requested a review from a team May 11, 2023 18:41
@radoering radoering force-pushed the pypa-packaging-compliance-performance branch from d15103b to 19492bb Compare May 11, 2023 19:33
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@radoering radoering merged commit f93c93a into python-poetry:main May 12, 2023
@radoering radoering deleted the pypa-packaging-compliance-performance branch November 24, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants