python / python/cpython

IDLE: In the shell, when a long line of output is written progressively, there is a big delay

Open
#96,560 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance topic-IDLE type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

I'm splitting this issue out of the discussion for issue #42973. Specifically, this comment by @mlouielu mentions:

Besides warping text, there has a performance issue inside the RPCServer and Client.

The (console, write, (text, file), {}) command is sent by server asynccall->putmessage. It should be sent by chunk size to client, and render on IDLE shell.

The result is performed as sent by chunk size, but the client will gather all chunk until it receives all data, then render on IDLE shell.

This cause the shell seems like hanging there, and doing nothing (in REPL, it will output the long string to stdout and so on).

We can manually detect this then manully chunk out (console, write, args, kwargs) command's args size, so that it will look like not hanging there.

The attach patch is a PoC about this.

Contributor guide

Open the contributing guide

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.

Research direction

Start with the linked discussion for issue #42973 and the IDLE RPCServer and Client handling of console write messages. Reproduce a long line written progressively, then verify that chunked output is rendered incrementally instead of waiting for all data to arrive.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.