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

GUI keyboard repeat rate suffers with many long lines #1259

Open
6 of 7 tasks
wfaulk opened this issue Aug 1, 2022 · 2 comments
Open
6 of 7 tasks

GUI keyboard repeat rate suffers with many long lines #1259

wfaulk opened this issue Aug 1, 2022 · 2 comments
Labels
Input Issues related to keyboard or other types of input

Comments

@wfaulk
Copy link

wfaulk commented Aug 1, 2022

Steps to reproduce

  1. Open MacVim (mvim --clean)
  2. Create a line 80 characters long (80ii<Esc>)
  3. Go to beginning of line (0)
  4. Hold down 'l' and time how long it takes to get to the end of the line (for me, about 3 seconds)
  5. Delete this line (dd)
  6. Create a line 700 characters long (700ii<Esc>)
  7. Make 90 copies of this line (yy90p)
  8. Go to column one, row one (1G0)
  9. Hold down l and time how long it takes to get to column 80 (for me, about 6 seconds)

(This affects insert repeat rate as well as cursor motion.)

(Also, I don't think this was a problem before the recent update to 9.0, but I could be wrong.)

Expected behaviour

The repeat rate shouldn't be affected by the data in the buffer.

Version of Vim and architecture

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 25 2022 08:23:03) macOS version - x86_64 Included patches: 1-65

Environment

MacOS 11.6.4
MacVim GUI

How MacVim was installed

Internal update; originally installed from download

Logs and stack traces

No response

Vim configuration where issue is reproducable

No response

Issue has been tested with given configuration

  • by running MacVim.app from GUI macOS interface
  • by running vim/gvim/etc installed by MacVim
  • by running other versions of vim (e.g. /usr/bin/vim)

Issue has been tested with no configuration

  • by running mvim --clean (or gvim, supplied by MacVim distribution)
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)

Other conditions

  • The both Homebrew packages "vim" and "macvim" are installed
@ychin
Copy link
Member

ychin commented Aug 4, 2022

I think this is a general rendering performance in our text renderer, and has been the case since before the latest 9.0 update (quick testing confirmed that as well). See #858.

I filed a new issue (#1262) to track this but for now I'm closing this because this isn't a bug per se, but a general rendering performance issue.

One related issue here is that MacVim would only get repeated key input when it's handling the keyDown event, but it doesn't know how many keys it should get. If it's blocking on the main thread (which is the case here due to slow rendering performance), it will cause the observed number of key repeats to be fewer (hence this bug). By moving to Metal, in addition to better performance, the rendering is also going to be done asynchronously which should alleviate this issue.

@ychin ychin closed this as completed Aug 4, 2022
@ychin ychin reopened this Aug 6, 2022
@ychin
Copy link
Member

ychin commented Aug 6, 2022

Actually, looking into it, I think MacVim has special logic in dropping repeated keys when it's lagging behind, which I do agree feels wrong. Let me think about it more.

@ychin ychin added this to the snapshot-174 milestone Aug 6, 2022
@ychin ychin added the Input Issues related to keyboard or other types of input label Aug 7, 2022
@ychin ychin modified the milestones: Release 174, Release 175 Aug 9, 2022
@ychin ychin modified the milestones: Release 175, Release 176 Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input Issues related to keyboard or other types of input
Projects
None yet
Development

No branches or pull requests

2 participants