Skip to content

Reduce typing latency caused by POLL_WAIT#846

Merged
fdncred merged 4 commits into
nushell:mainfrom
yizhepku:fast-poll-wait
Oct 22, 2024
Merged

Reduce typing latency caused by POLL_WAIT#846
fdncred merged 4 commits into
nushell:mainfrom
yizhepku:fast-poll-wait

Conversation

@yizhepku

@yizhepku yizhepku commented Oct 17, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

yizhepku commented Oct 18, 2024

Copy link
Copy Markdown
Contributor Author

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
@fdncred

fdncred commented Oct 22, 2024

Copy link
Copy Markdown
Contributor

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