onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 300 forks source link

Lag when scrolling #2620

Closed Siilwyn closed 4 years ago

Siilwyn commented 5 years ago

Oni Version: 0.3.6 Neovim Version (Linux only): 0.3.1 Operating System: Linux, Solus

Scrolling lags a lot and takes a while to 'catch up', both when navigating and scrolling by mouse: https://gfycat.com/PerfectVigorousAnemonecrab

So it looks like I'm scrolling slowly but I'm actually holding down j at the beginning. Hardware might be relevant? Running on a MacBook Pro (AMD Radeon R9).

jordwalke commented 5 years ago

I am noticing the same thing. I took a profile of it and it seems like the key events are getting queued up and end up overlapping somehow. When I release the key, it keeps scrolling probably to catch up.

screen shot 2018-10-13 at 4 02 40 pm

On the latest preview/release for OSX.

You can repro by setting your keyboard repeat rate to be really high (mine is set to 60fps). You can set it to 60fps by doing defaults write -g KeyRepeat -int 1 (if you chose 2 then it would be 30fps).

akinsho commented 5 years ago

@Siilwyn @jordwalke I believe our input manager attempts to identify chords as part of an initial implementation of allowing oni to take chorded input I haven't looked at that part of the codebase much yet but there were other performance related issues, @bryphe is probably best suited to provide any hints if he's available (we also recently increased the number of MAX_CHORDS @bryphe which might be why this is suddenly worse)