New submission from Roger Serwy <roger.se...@gmail.com>:

The shell provided by IDLE uses synchronous sys.stdout.write() calls between 
the subprocess and the front-end, leading to very slow writes. The provided 
patch proposes buffering the stdout/stderr streams in the subprocess and then 
sending a single update after 50ms. The patch also provides back pressure on 
the buffer so that it doesn't grow without bound.

When trying the behavior of the patch, disable the squeezer extension, or set 
its limit to 1000. Then in the shell, run:

    for i in range(500): print(i)

The output will instantly appear in the shell.

----------
files: idlelib_buffer_output.patch
keywords: patch
messages: 406306
nosy: roger.serwy, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE - faster shell writing
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file50438/idlelib_buffer_output.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45804>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to