_prune_and_count iterating over collection twice
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 155
- Forks
- 182
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
In launch_service.py, the methods LaunchService._prune_and_count_entity_future_pairs() and LaunchService._prune_and_count_context_completion_futures() perform an unneeded scan through their respective containers just to decide if another scan (using the exact same check) is needed to prune their respective containers (LaunchService._entity_future_pairs and LaunchService.__context.._completion_futures)
I am not sure if this would cause any issues with the launch process, but it looks a bit odd. If there are a lot of elements in either of the collections, it could conceivably be the cause of a slowdown.
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 in launch_service.py with LaunchService._prune_and_count_entity_future_pairs() and LaunchService._prune_and_count_context_completion_futures(), then inspect _entity_future_pairs and __context.._completion_futures. Compare the repeated checks and confirm that pruning behavior remains unchanged while the unnecessary scan is removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100