-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
GH-130328: Speedup pasting in legacy console on Windows #133728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
chris-eibl
commented
May 9, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Pasting in new REPL is slow #130328
for i in range(rec_count): | ||
rec = recs[i] | ||
# In case of a legacy console, we do not only receive a keydown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there is a lot of duplicated logic from get_event
now. Maybe refactor that, so the logic can be reused here?
@@ -449,8 +442,11 @@ def get_event(self, block: bool = True) -> Event | None: | |||
and there is no event pending, otherwise waits for the | |||
completion of an event.""" | |||
|
|||
if not block and not self.wait(timeout=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved blocking and waiting logic into get_event
like in unix_console.py
. IMHO that shouldn't be part of reading and we're in perfect sync with Unix now.
@@ -484,7 +491,6 @@ def do(self) -> None: | |||
data = "" | |||
start = time.time() | |||
while done not in data: | |||
self.reader.console.wait(100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed. Works for me without it. For both, Linux and Windows, this will immediately return in case of pending data, and just needlessly waits 100 ms if there is no more data.