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

Reduce typing latency caused by POLL_WAIT #846

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

YizhePKU
Copy link
Contributor

@YizhePKU YizhePKU commented Oct 17, 2024

This PR makes it so that Reedline no longer wait for POLL_WAIT after every keystroke. Instead, the delay is only triggered if text pasting or resizing is detected.

It also re-introduces a fix from PR #651. That PR was reverted by #840 because of issue #757 about external printers. If the feature external_printer is not enabled, this PR will just block on input forever for maximum power efficiency. Users with external_printer enabled will also see a small improvment in power efficiency, because this PR makes it possible to use a longer polling inteval without affacting typing latency.

Fixes #643, #10484, and #521, and hopeful doesn't break #757.

@YizhePKU
Copy link
Contributor Author

PR draft #737 discussed reworking the external printer API. I wonder how is that going?

Technically not part of the PR, but let me smuggle this in real quick.
@sholderbach
Copy link
Member

Nushell doesn't make use of the external printer, so politically it takes precedence in that decision in my view. We should prioritize the battery saving behavior and figure out a solution for a responsive external printer in due course. (as the stalling of #737 shows, probably non trivial refactor needed.)

@YizhePKU
Copy link
Contributor Author

YizhePKU commented Oct 18, 2024

We should prioritize the battery saving behavior and figure out a solution for a responsive external printer in due course.

This PR aims to be maximally power efficient when the feature external_printer is NOT enabled. External printers are still responsive when enabled. It's the best of both worlds!

@fdncred fdncred merged commit 9cb1128 into nushell:main Oct 22, 2024
6 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Oct 22, 2024

Thanks. Let's move forward with this since it's early in our release cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POLL_WAIT hurts user experience
3 participants