python-poetry / python-poetry/poetry
Proportion of Time Spent on Cloning is Significant during `poetry lock --no-update`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the FAQ and general documentation and believe that my question is not already covered.
Feature Request
Title: Proportion of Time Spent on Cloning is Significant during poetry lock --no-update
Body:
While running Poetry and cProfile locally, I noticed that a significant amount of time is spent on the cloning process, as depicted in the image below.
I made some modifications to replace the clone operation with a shallow copy, copying only necessary attributes. (I adjusted it to pass the tests by defining "necessary attributes".)
As a result, I was able to significantly reduce the time spent on the cloning operation, as can be seen in the following image. In addition, the processing time also improved significantly:
From
Resolving dependencies... (58.9s)
to
Resolving dependencies... (34.5s)
Would you be interested in this improvement? If so, I would like to create a PR right away.
environment
poetry: e8ca4b32ceeb1648eaba6bed49e8b36dcfbf0cc0
poetry-core: f09d84a4c6ad6d1117998ff9d46949e1bd819f5b -> 86a0ec388eb7581c3c3b3d0f78848aa85f434893
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by profiling poetry lock --no-update with cProfile and confirm how much time the cloning process consumes. Review the existing clone behavior and tests to determine which attributes are necessary, then verify that the tests still pass and that dependency resolution shows a measurable improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100