Skip to content
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

REPL: try to coalesce screen updates #39538

Merged
merged 1 commit into from
Mar 8, 2021
Merged

REPL: try to coalesce screen updates #39538

merged 1 commit into from
Mar 8, 2021

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Feb 5, 2021

When input is arriving too fast, delay computing and rendering the full
screen until a short delay after typing stops. In particular, during testing,
this helped allow pasting into Windows consoles run at near full speed
with less excessive screen tearing.

When input is arriving too fast, delay computing and rendering the full
screen until a short delay after typing stops.
@vtjnash vtjnash added the REPL Julia's REPL (Read Eval Print Loop) label Feb 5, 2021
@kshyatt
Copy link
Contributor

kshyatt commented Feb 6, 2021

Test failure here is a timeout

@vtjnash
Copy link
Member Author

vtjnash commented Feb 7, 2021

FWIW, the timeout is an ArgTools bug (#39544), and I'm currently trying to find a way to work around that, as it is depending on a posixism, but a seemingly fairly reasonable one.

@vtjnash vtjnash requested a review from Keno February 10, 2021 16:15
@Keno
Copy link
Member

Keno commented Mar 3, 2021

I'm not a huge fan of the REPL just kicking off time-based work since it makes things somewhat unpredictable. I don't suppose Windows tells us if there's any more characters coming? That said, this is probably fine, since we'll always call clear_input_area before leaving the REPL, so at least we won't be interrupting any actual output.

@vtjnash
Copy link
Member Author

vtjnash commented Mar 3, 2021

yeah, short of inverting this entirely to an MVC-style app, I tried to be careful here to complete the render if demanded

tells us if there's any more characters coming

We probably already have them in the read buffer, and we'll process them ASAP? But that is quite nearly what this PR is exactly doing: checking to see if more characters are about to arrive before pushing a more expensive re-render.

@vtjnash vtjnash merged commit 26d887e into master Mar 8, 2021
@vtjnash vtjnash deleted the jn/slow-repl branch March 8, 2021 19:17
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
When input is arriving too fast, delay computing and rendering the full
screen until a short delay after typing stops.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
When input is arriving too fast, delay computing and rendering the full
screen until a short delay after typing stops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants