Runner.respond uses join leading to slowness

Open Beginner friendly
#1,079 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
cli, performance

Research direction

Start at the Runner.respond entry point and run the pytest suite over invoke, focusing on output handling with and without watchers. The change is done when large output no longer repeatedly joins the buffer when no watchers are attached, while watcher behavior remains intact.

Written by the indexing model from the issue text.

Description

Runner.respond uses a join call of the whole buffer + the new content. We execute pytest over invoke and it can happen, that the pytest output is several hundred MB big. For each line of these, the join is executed leading to a slower and slower processing. For reference, 300MB takes about 2h to process.

Recommendation: as the join is only needed if watchers are used, it can be avoided if no watchers are attached

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.