microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
165.18k stars 29.62k forks source link

1.36 scrolling suddenly laggy - precision touchpads #76594

Closed frevds closed 12 months ago

frevds commented 5 years ago

Since updating to 1.36 the scrolling experience got bad. I increased the multiplier to have the same speed, but it still feels "heavy" to scroll, not the same as before - what change could be the cause for this?

Same in the explorer view (with or without the new guides). Here it looks like the renderer skips frames, jumpy and not calm (also the scroll multiplier does not seem to have an effect here, merely Alt).

I'm using a precision touchpad device (Dell) but this is not the old problem and cannot be solved by resizing the window.

It is especially annoying in the explorer tree, bordering close to the unusable level. After trying for a while I will now downgrade to 1.35.x. This seamingly little handicap somehow greatly impacts productivity, at least for me, feels like having a slow computer.

Update: Yes, 1.35.1 is definitely faster and lighter to scroll (did you add some animation? my setting for 'smooth scrolling' is deactivated). I will have to stay on this version until this is fixed.

Cannot find anything in the release notes except "This is a major Electron release and comes with Chrome 69 and Node.js 10.11.0 (a major leap forward from our current version with Chrome 66 and Node.js 10.2.0)". I guess it won't be easy to locate the issue. However, the new version is not usable, for me (Windows 10, precision touchpad).

yo-raff commented 5 years ago

I have the exact same problem! It was fine before i update it to 1.36

aloeugene commented 5 years ago

I've started experiencing the same issue after the latest update.

I have always had editor.smoothScrolling: false, but after the update yesterday it doesn't really change anything... Be it true or false - no difference.

bpasero commented 5 years ago

Wait, does anyone here have editor.smoothScrolling: true and now it is not smooth anymore or is it just not smooth anymore in general?

Is it only not smooth in the editor, or also on trees in the sidebar?

aloeugene commented 5 years ago

For me, it’s everywhere: editor, sidebar, settings.

bpasero commented 5 years ago

@aloeugene what exact device and OS is that?

yo-raff commented 5 years ago

@bpasero It's everywhere. I have tried toggling editor.smoothScrolling but it has same results.

Device : Surface Laptop 2 - Intel Core i5-8250U OS : Windows 10 Home - 64bit (With Windows Precision Touchpad)

frevds commented 5 years ago

smoothScrolling also doesn't have any noticeable difference for me, neither in 1.35.1 nor 1.36. OS: Windows 10 Pro for Workstations CPU: Intel Xeon E3-1505M v6 3GHz, 32 GB RAM, Precision Touchpad.

I didn't try using a mouse when I had 1.36 installed and can currently not verify it without updating again. Can somebody currently running 1.36 confirm that the issue persists when using an external mouse to scroll and has thus nothing to do with the precision touchpad device? Then it can only be the new Chrome renderer or new Electron or new Node, granted, not an easy task to find the issue. If I can help testing things in case you cannot reproduce the effects, let me know.

frevds commented 5 years ago

Hm, now I just updated to 1.36 again and it looks smoother than yesterday (no frame-skipping, although I didn't restart or change anything), but definitely at first glance it is much slower (smooth but very heavy to scroll, a full swipe gets me a few animated centimeters far, not a screen as i used to. The precision touchpad always scrolls smooth, the external mouse does not (only when switching on smooth scrolling), but i guess that's alright, given that the mouse wheel scrolls are measured in lines.

I made videos (though they cannot capture the real 60fps+ experience one clearly sees and feels that 1.35.1 is light to scroll and 1.36 is heavy). I made three short swipes and three long swipes in both directions, in the code editor, the explorer view and the settings window, compare how 1.36 is long and animated and hard to control, and the explorer view flickers (irrespective of the tooltip): https://www.dropbox.com/s/zttomzencx8oz8m/vsc-precision-touchpad-v1.35.1.mp4?dl=1 https://www.dropbox.com/s/o3teeqtbcjwago2/vsc-precision-touchpad-v1.36.mp4?dl=1

I also used an external mouse wheel, here I don't see a difference at first glance, but then I never work with an external mouse. https://www.dropbox.com/s/384kth1podeymie/vsc-wheel-v1.35.1.mp4?dl=1 https://www.dropbox.com/s/gw8fjlh20htxf8u/vsc-wheel-v-1.36.mp4?dl=1

frevds commented 5 years ago

Alright, I guess I can live with that now as it is, if I adjust the 'Mouse Wheel Scroll Sensitivity' to about 3x. The long animation is a little annoying, but I will get used to it, apparently something changed in Chrome with respect to precision touchpads in a newer version. The explorer view is terribly slow to scroll because it does not care for the sensitivity setting, but workable (don't know why but yesterday it was not usable at all, I wonder what's different now, since I did not restart or update or even close anything, also no difference whether on battery or charging). So from my perspective it's does no longer look like a slower rendering with frame-skipping, but just more animation and different behaviour. I don't know about @yo-raff and @aloeugene, try installing 1.35.1 and again updating to 1.36, maybe that helps.

frevds commented 5 years ago

By this old page, chrome added support for precision touchpads with v68, if I read that right: https://www.reddit.com/r/chrome/comments/98zglr/when_is_precision_touchpad_support_coming/ So if VSC now switched from v66 to v69, this would explain why there is a sudden change in scroll experience. maybe it can be tuned (and maybe it should be tested on laptops with such a touchpad, since that's the primary input device for most users having a Dell Precision/XPS or Microsoft Surface Laptops. According to this page (https://www.howtogeek.com/286905/what-is-a-precision-touchpad-on-windows-pcs/) it soon will be every Windows machine.

aloeugene commented 5 years ago

@bpasero, I’m currently on HP EliteBook 840 G4 with Intel core i5 7th gen, 16gb RAM. Windows 10 Enterprise.

Also, I’m always using touchpad, and it's the precision one, so I can’t say if this issue relates to mouse scrolling as well.

bpasero commented 5 years ago

@frevds @yo-raff @aloeugene We are building exploration builds that use a much newer version of our UI framework (Electron version 6.0.x). I wonder if this issue reproduces with one of these builds, could you try? Download:

aloeugene commented 5 years ago

@bpasero, as for me on Windows, switching on/off smoothScrolling still doesn't change anything, scroll is always smooth.

However, it's not that laggy anymore, quite stable and is really smooth 😃

Actually, with smoothScrolling off, it's fine and cool. But when it's on, it becomes more laggy and twitchy.

bpasero commented 5 years ago

Please do not configure the editor.smoothScrolling setting and try it outside the editor, I am only concerned about scrolling in general. Does Electron 6 improve things?

aloeugene commented 5 years ago

Well, it doesn't really change things for me. Somehow, stable VSC build is behaving the same as Exploration build.

frevds commented 5 years ago

1.37 looks identical to me with respect to the scrolling behaviour, BUT it is very smooth (no skipping, no latency, generally usable). Just it is very animated (cannot be deactivated and scrolls out very long after letting go). Without setting the scroll sensitivity multiplicator it is too slow by default. Also, the explorer view ignores the multiplicator and scrolls way too slow to use (only holding Alt helps).

yo-raff commented 5 years ago

@bpasero the new build has better animation when scrolling (smoother) than 1.36, but it's still worse than 1.35.1

the scrolling speed is too slow in 1.37 (new build) compared to 1.35.1 (both has same setting)

aloeugene commented 5 years ago

One more thing that happened to me couple times already, but I haven't really found steps to reproduce: Sometimes scrolling with touchpad in editor just stops working. Scrolling with "pg up/down" buttons works, but not with two-finger scrolling. However, I still could easily scroll through sidebar menu... Strange stuff's going on with this version.

frevds commented 5 years ago

And I do have frequent freezes with this version which I didn't have before, might have to do with code highlighting changes and long lines. Comes in arbitrary intervals and lasts as long as 3 seconds, complete main-thread blocks for a while.

mihai80 commented 5 years ago

I'm experiencing the same problems with VSCode 1.36.1 on Windows 10 1903 with Precision Trackpad hardware. What's bizarre is how just while typing this the scrolling has returned to normal. Although I switched Smooth Scrolling on and off, it didn't do anything in particular at the beginning. Now, with the option on I am working smoothly with short scripts, while anything over 100 lines is struggling to keep up.

My personal guess is Python Language Server, and the extreme CPU consumption when opening large projects, might contribute to the first extreme lag I notice. Testing with a short C# project seems to give positive results, without the CPU and memory hang.

yo-raff commented 5 years ago

Any updates regarding this issue?

redtopia commented 5 years ago

2 finger touchpad scrolling on my Dell Precision randomly stops working. It just started happening recently, but I'm not sure which update did it. I'm running 1.36.1 on Windows 10 Pro build 1809. It has happened to me 4 times today, and the only thing that fixes it is to quit vscode and restart. I haven't made any changes to any scroll settings ever, so I believe I should be running all the defaults.

aloeugene commented 5 years ago

Any news? Such behavior is really annoying... After couple hours in Atom it's very hard to return back to VSC with scrolling issues :)

aloeugene commented 5 years ago

Hi everyone! Are there any updates? Is it going to be fixed somehow someday?

deepak1556 commented 5 years ago

I will backport fixes from https://bugs.chromium.org/p/chromium/issues/detail?id=914914 into our electron 6 branch update https://github.com/microsoft/vscode/pull/81644 to see if there is any improvement. Will move on from there.

alexdima commented 5 years ago

@frevds @yo-raff @aloeugene

Can you please try out our insiders build -- https://code.visualstudio.com/insiders/ -- and let us know if scrolling with the touchpad is working better?

frevds commented 5 years ago

@alexandrudima Hm no, exactly the same I would say, but I got used to it (the explorer tree is very slow and needs Alt to be pressed because it keeps ignoring the scroll multiplier, and the code view scrolls fine with the multiplier but has to be stopped since it will graciously and slowly scroll out over another screen height). The new electron versions don't solve the issue, I reckon it's a chrome issue with Precision Touchpads where you cannot do much. It's not bad, it's just not as good as before.

aloeugene commented 5 years ago

Yep, as @frevds said, it's exactly the same for me too. It's a shame scroll multiplier doesn't work for explorer tree, would be handy not to touch Alt key every time I try to find something :) But it's true, you're just getting used to it and live with it... Scroll multiplier saves the situation for code editor, but it feels more like a workaround, not a solution.

MythreyaK commented 5 years ago

Have the same issue here. Scrolling is jumpy, laggy, and all scroll events spike CPU usage to 40%. Past workarounds do not help (full screen mode). I'm having to set my laptop to "High performance Mode" for it to scroll better 😂.

mofux commented 5 years ago

@alexandrudima I'm not sure if it's the same problem, but I can easily reproduce the problem in the monaco-editor@0.18.1 on Chrome and MacOS 10.15 (Catalina).

Steps to reproduce:

Got to the playground: https://microsoft.github.io/monaco-editor/playground.html

Paste the following snippet and hit Run:

monaco.editor.create(document.getElementById("container"), {
    value: "function hello() {\n\talert('Hello world!');\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}",
    language: "javascript",
    smoothScrolling: true
});

Try to scroll the editor, it won't be smooth. Using page-up and page-down to scroll will result in a smooth scrolling animation though.

thany commented 4 years ago

Any updates on this? We're a few months further and it's still not resolved in 1.40.2. It a pretty annoying problem to deal with, when not using a mouse.

Firefox is completely responsive and super snappy. Even through my TV which has a pretty noticable input lag. On my main screen, with much lower input lag, VScode manages to lag so much that it's making me uneasy. I already have problem with scrolling, and lag is making it worse.

If this cannot be solved as part of performance improvements, it should be fixed as an accessibility problem. A code editor should not make a person literally sick.

taliesinb commented 4 years ago

@thany @alexdima

I can confirm this is still the case in 1.42.1, on macOS Catalina. I have more useful information, though: it appears to be tied to a (roughly) 5 second timeout. I noticed this because I have keyboard backlight auto-dim to 5 seconds, and trackpad activity wakes it up. This means it is visually easy to tell if it has been less than or more than 5 seconds since the last trackpad activity.

If i got into a text editor view, and use rapid two-finger scroll to bounce up and down a bit, and then wait for the keyboard to dim out, and do the two-finger dance again, it completely ignores that input for about 1 second, and then catches up. This is incredibly distracting and annoying, because it breaks the fundamental illusion that I can move the editor window around with my two fingers as if it was a piece of paper. But if I wait slightly less than five seconds: no problem.

So to clarify, the bug I can reproducibly see, and probably anyone with a mac can see, is scrolling jank after 5 seconds of inactivity. I would guess this is some kind of throttling of UI polling frequency that happens after 5 seconds to save battery life.

To turn on the auto-dim feature to help reproduce this bug: System Preferences > Keyboard > Keyboard pane > check "Turn keyboard backlight off after [ 5 seconds ] of inactivity".

thany commented 4 years ago

@taliesinb Your issue is completely different. First of all, you're on macOS, so I pretty much guarantee you will not be using a Precision touchpad (and if you are, why??)

The lag has nothing to do with waking up. It's always there.

Even if the issue you described is what we're having, it would mean it's laggy in every application. But it's actually completely snappy and working perfectly everywhere. Except in VScode where is nauseatingly laggy.

dzpt commented 4 years ago

Version: 1.43.2

i'm using macOS and vscode scrolling is even laggy more than pycharm now. editor.smoothScrolling: false doesn't work

ElSamhaa commented 4 years ago

version 1.44.2 Fedora 31 Thinkpad L470 (Synaptics touchpad) same jumpy scrolling, turning the option off or on has no effect.

update: version 1.45 Fedora 32

Tried purging vscode completely before installing the new 1.45 update, but no luck. What's interesting though is that scrolling is smooth on release notes page, but lags on every other source file, even with bare vscode before installing any extensions.

thany commented 4 years ago

Yep, still the same in 1.44.2 and in the Insiders build 1.45 (commit 9328b320).

I wasn't exaggerating when I said nauseatingly laggy. I'm sensitive to input not matching up with the things I'm seeing on screen. Smooth scroll (by a "ticky" scrollwheel, when I can use a mouse) is therefor disabled. I really can't handle that 🤢

Can anyone explain why this is not being worked on? Perhaps it's being brushed off internally, but it really is a problem in VScode. No other app has this problem.

jingyao-zhang commented 4 years ago

Version: 1.44.2 OSX version: 10.15.4

Just moved from sublime text to vs code. The scrolling lag is terrible. I can see the obvious losing frames in vs code compared with sublime text. Not working by setting smooth scrolling true or false.

Update: Vscode is not as smooth as sublime in my ubuntu desktop, neither.

mohdyusuf commented 4 years ago

Version 1.44.2 Windows 10

Same scrolling stutter.

mvacha commented 4 years ago

I'm also experiencing this in version 1.44.2 on Windows 10 1909 on a laptop with a precision touchpad. The issue is super anoying and the editor is really uncomfortable to use because of it. No other electron app I use (Notion and Slack) has this issue, so the root cause might not be in chromium/electron itself.

thany commented 4 years ago

Same scrolling stutter.

Stutter? It's not stuttering for me. It's smooth as butter, but also lagging behind.

munael commented 4 years ago

Suddenly a very noticeable issue after upgrading to Windows 10 2004. VSC: 1.49.0-insider 2020-08-28

lvkins commented 4 years ago

Lately scrolling or typing experience became very laggy for me, to the point where I had to move to the WebStorm until it's fixed.

My setup is:

Version: 1.49.1 (user setup)
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:27:51.792Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18363

Here is a preview of what it looks like, recorded at 30FPS (open image in new tab for better resolution). Got all my extensions disabled, tested on plaintext tab to exclude potential issues. It's quite laggy, but one might live with that. noextensions It's just as laggy as with the extensions enabled regular

However, when a file has long lines (the horizontal scrollbar appears), it gets really bad. The text is from https://loremipsum.io/ (took 10 paragraphs).

longlines

frevds commented 4 years ago

@lvkins Interesting, but I can't reproduce that (copied 4x 10 paragraphs). I have much bigger files with actual code highlighting (10000 lines and all quite long) without issues. Sure you have all extensions deactivated (what is this on the left in your status bar, i don't seem to have it) and your computer is not in any battery-saving mode (with the old version of VSCode there is no issue?)? In any way, you should post this as a separate issue, since this issue here is more about Precision Touchpad scrolling lags and overanimation than text highlighting (you want to do that since nobody hears us here anyway; this ticket has been open for months (since v1.36) and nobody feels responsible and/or capable to solve it).

lvkins commented 4 years ago

@frevds Extensions are disabled in the first GIF. It made no difference if I disabled them whatsoever so I decided to keep them turned on. The issue seem to be the VSCode itself. I had an old, bare version of VSCode Insiders that was v1.39 - no such issue there, with 1000s of lines... then I updated to the latest insiders v1.50 and the slideshow has started.

I'm aware that your issue is quite different. Will indeed open my own but looking at your case makes me think it's really a waste of time.

frevds commented 4 years ago

@lvkins You should pinpoint the exact version when things went wrong then. The older versions can all be downloaded. Our issue here is not easily fixed since it seems to involve Chrome itself, not Electron and not VSCode. Your issue however seems to be linked to processing syntax hilighting. Also check on other computers. I don't see bad performance when I try out your example.

lvkins commented 4 years ago

@frevds What makes you think it's linked to syntax highlighting? I tested it on neutral, plaintext tab (i.e. no syntax highlight) in order to /among others/ - ensure it's not.

frevds commented 4 years ago

@lvkins Yes, not exactly syntax but the broader topic of line processing. There is a lot going on, especially with extensions and there has been done a lot and changed a lot since your v1.39. It would probably be benefitial to find out when things went wrong, i.e. which new feature or change causes this, which you can find out by installing older versions and then looking at their release notes when you notice differences. Reproducing the issue is not so easy either, hence you could be in a unique position to find the issue and they could improve on your feedback.

LoudSoftware commented 4 years ago

Having exactly the same issue on the latest 1.49.1 version.

Scrolling with the touchpad is very slow and keeps on scrolling after I take my fingers off the touchpad. Very annoying.

Version details:

Version 1.49.1 (user setup)
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041
thany commented 4 years ago

Should've probably built VScode on the Gecko engine 😎 because scrolling by Precision Touchpad in Firefox is absolutely realtime and buttery smooth. I don't use Chrome (the browser, that is) so I can't speak for that one.

joske commented 4 years ago

I'm using vscode on linux but on a VM that I connect to remotely with x2go. Scrolling in chrome, even inside remote desktop to another windows (for internet - no internet on VM itself) is totally fine. Eclipse also totally fine on same machine, same code. Scrolling with the mousewheel or dragging the scrollbar is very slow in vscode.