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

Sluggish scrolling in notebook windows [monaco editor restore] #117644

Open
DavidKutu opened this issue Feb 25, 2021 · 31 comments
Open

Sluggish scrolling in notebook windows [monaco editor restore] #117644

DavidKutu opened this issue Feb 25, 2021 · 31 comments
Assignees
Labels
debt Code quality issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues notebook-perf
Milestone

Comments

@DavidKutu
Copy link

@oscarrutt commented on Mon Feb 22 2021

Scrolling in Jupyter notebook windows is sluggish, laggy, and jumpy. It's not horrible but it is bad enough to cause stress, aggravation, and fatigue. Scrolling is nowhere as nice as in other applications when you get that "massless" feeling. JupyterLab in Firefox is an example of a Jupyter notebook that runs in a cross-platform environment that scrolls nearly perfectly. The problem appears when scrolling with either two-finger drag on the trackpad or click-dragging the thumb bar in the elevator region.

My computer runs macOS 10.11.6. This is an older version of the OS but it should have no effect on scrolling since all other apps scroll well.

I'm using Jupyter in VSCode Insiders to write Julia. I don't know if the problem extends to non-Julia notebooks.

Version: 1.53.0-insider
Commit: 8490d3d
Date: 2021-02-03T15:52:19.585Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 15.6.0


@jaymegordo commented on Mon Feb 22 2021

+1 I've noticed this as well since I started using insiders + native notebooks. (both python and R)

Version: 1.54.0-insider
Commit: 11cd760
Date: 2021-02-22T06:44:36.656Z
Electron: 11.2.3
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0


@DavidKutu commented on Mon Feb 22 2021

Thanks for letting us know @oscarrutt. I checked on a windows 10 laptop and couldn't feel a difference. I'll make sure to have someone test it with a mac.


@DavidKutu commented on Wed Feb 24 2021

@oscarrutt and @jaymegordo, does this only happen with native notebooks? Does it happen say, on a regular python file in vs code?


@jaymegordo commented on Wed Feb 24 2021

@DavidKutu I remember really noticing jittery/slow scrolling when I switched from "old notebooks" to native notebooks a few moths ago. In a standard large python file I can scroll top-bottom in a fraction of a second, but in a NN there's definitely a bit more resistence. I assume this is probably just related to rendering all the extra assets (tables/charts etc). I think the NN scrolling has improved since I first started using it, but I cant actually compare to the old notebooks right now because they don't even work in my stable vscode (I think its something related to "experimental" settings, haven't had time or need to make it work). Its not horrible, just makes me a bit more hesitant to want to scroll around quickly.

So in summary, NN scrolling is definitely slower than a regular python file, but could just be the extra stuff to render. If I can get my old notebooks working I'll try and give a side by side comparison.


@oscarrutt commented on Wed Feb 24 2021

@DavidKutu It does not happen with a regular Python file. As far as I can tell it does not happen with any text file in either vsc or vsc-i.

But to be clear, as far as I can tell, no text file in either vsc or vsc-i scrolls as well as in a native Mac app. One does not have to look far: TextEdit, XCode, or even the Quick Look window in Finder. It's just that the problem as reported here is past the point of acceptability IMO.

I can (now!) open Julia native notebooks in vsc. (I thought that wasn't possible a week ago. Am I confused? The display is different, with different backgrounds and widgets but no syntax coloring in vsc.) In any case, my Julia native notebooks seem to scroll as well in vsc as text scrolls in vsc. Hope this isn't too confusing.

@rebornix
Copy link
Member

@oscarrutt @jaymegordo

Could you please try following to provide more info to help troubleshoot?

@rebornix rebornix added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster notebook labels Feb 25, 2021
@oscarrutt
Copy link

CPU profile attached. Sorry for the delay.
CPU-20210228T041538.cpuprofile.zip

@rebornix
Copy link
Member

The cpu profile doesn't seem to give us enough info about why it's sluggish, @oscarrutt do you mind try "Performance" recording in Dev Tools?

image

@oscarrutt
Copy link

Should I scroll while the profile is recording? Also, should I --disable-gpu as before?

@oscarrutt
Copy link

Here is a recording of about a minute in VSCode-Insiders. I vigorously scrolled the Julia notebook in the left tab which was about 1/4 to 1/3 of the screen width, with the Dev Tools tab occupying most of the screen.

(BTW, VSC-Insiders leaves one orphaned Python and two orphaned Julia processes after it quits. They have to be manually killed. I believe this also happens after a window crash. Not sure what happens with VSCode. Should I make a separate ticket?)
Profile-20210327T044354.json.zip

@DavidKutu
Copy link
Author

Hi @oscarrutt, could you please check if the issue is still present in VS Code 1.57?

@oscarrutt
Copy link

Well, it's complicated. VSC 1.57.0 crashes the extension host on some computers including mine #126031 et al. This also happens with VSC-insiders 1.58.0 which I just downloaded.

Version: 1.58.0-insider
Commit: 3e0c442
Date: 2021-06-16T05:17:11.301Z
Electron: 12.0.11
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 15.6.0

and also an older VSC-insiders 1.58.0

Version: 1.58.0-insider
Commit: 012b146
Date: 2021-06-11T05:12:17.675Z
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 15.6.0

So this means that I can't run the Jupyter extension in either VSC 1.57.0 or VSC-insiders 1.58-0 and so I can't answer your question until the other problem gets fixed.

@rebornix
Copy link
Member

rebornix commented Jul 7, 2021

@oscarrutt thanks for sharing the log, the log is actually pretty helpful. It indicates that the scrolling was slowed by the monaco editor instances, which are usually fast to create and restored

image

Did you record this with gpu disabled?

@rebornix rebornix changed the title Sluggish scrolling in notebook windows Sluggish scrolling in notebook windows [monaco editor restore] Jul 7, 2021
@rebornix
Copy link
Member

rebornix commented Jul 7, 2021

if you get a chance to use the latest Stable or Insiders, it should be a bit faster as now we move the markdown rendering into webview, which should hurt the performance of scrolling anymore.

@rebornix rebornix removed the info-needed Issue requires more information from poster label Jul 7, 2021
@oscarrutt
Copy link

@rebornix
I don't remember if I recorded with the gpu disabled.

Tested now with Insiders as below. (Current Insiders no longer crashes the extensions host upon launch as it did for many macOS users.)

Version: 1.58.0-insider
Commit: 2d23c42
Date: 2021-07-07T12:08:00.172Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 15.6.0

I just now tested without gpu disabled and with code-insiders --disable-gpu. I don't notice a difference in scrolling behavior in either case. Sorry.

@rebornix
Copy link
Member

rebornix commented Jul 8, 2021

@oscarrutt thanks for the info, I think I know what's going on now.

@xtttttttttx
Copy link

I met the same issue. Scrolling is very sluggish! Everything is fine except notebook.

Version: 1.59.0
Commit: 379476f
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.6.0

@rebornix
Copy link
Member

rebornix commented Aug 6, 2021

@xietx1995 is it slow when you run VS Code with gpu disabled?

@xtttttttttx
Copy link

xtttttttttx commented Aug 7, 2021

@xietx1995 is it slow when you run VS Code with GPU disabled?

Yes, it is. But it's a little bit smoother without GPU acceleration.

I tried the same notebook file on an M1 MacBook Pro, and there is no lag.

@Ar9av
Copy link

Ar9av commented Aug 31, 2021

Any update on these?
Very sluggish scrolling over medium size python notebooks as well.

Version: 1.59.0
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.6.0

Using 2018 Macbook Pro.

@oscarrutt
Copy link

No change here. Just updated to 1.61.0 Insiders.

Version: 1.61.0-insider
Commit: 8726024
Date: 2021-09-03T21:01:10.842Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 15.6.0

@ZZYSonny
Copy link

ZZYSonny commented Sep 6, 2021

I noticed scrolling in a large py file uses 15~20% GPU in the task manager, but scrolling in a jupyter file uses ~45% GPU.

Version: 1.60
Electron: 13.1.8
Chrome: 91.0.4472.164
OS: Windows_NT x64 10.0.22000

@kasperweidick
Copy link

Same issue here. The scrolling is very jittery and sluggish. And it only happens in .ipynb (notebook) files.

Version: 1.60
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

Mac OS: Big Sur, Version 11.5.2 (20G95)

@jingw222
Copy link

Same here. Not very delighting to use compared with JupyterLab

Version: 1.60.0
Commit: e7d7e9a
Date: 2021-09-01T10:54:53.442Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

@apockoffork
Copy link

This issue has been biting me too. Scrolling is bad enough to make it almost unusable.

Version: 1.60.0
Commit: e7d7e9a
Date: 2021-09-01T10:43:02.136Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.4.119-14945-gafc97d54f809

@spuulis
Copy link

spuulis commented Sep 20, 2021

It seems that the lagginess becomes even more pronounced when the notebook is viewed on large displays. Consequently, by making the window very small, the lag almost completely (yet not quite) disappears. And this effect too is apparent only with .ipynb files (other text based files, including the terminal, remain without any noticeable lag, even when viewed in large resolution).

@rebornix
Copy link
Member

We just pushed some changes to improve the scrolling performance (mostly around forced reflow #126880 (comment)). It fixes slugging scrolling for some but not all, but it would be really great if you can try the latest Insiders and see if you are still seeing the same slowness. If so, can you please follow the step here https://github.com/microsoft/vscode/wiki/Performance-Issues#sluggish-ui and share the log with us so we can dig into which operation is the most costly one?

@oscarrutt
Copy link

I don't see any change. Log attached. 13 MB zipped?1?
Profile-20210927T193951.json.zip
1

@rebornix rebornix modified the milestones: September 2021, On Deck Sep 29, 2021
@rebornix rebornix added polish Cleanup and polish issue debt Code quality issues and removed polish Cleanup and polish issue labels Oct 11, 2021
@rebornix rebornix removed the notebook label Oct 21, 2021
@kieferrm kieferrm modified the milestones: On Deck, November 2021 Nov 7, 2021
@rebornix rebornix modified the milestones: November 2021, December 2021 Dec 1, 2021
@heshamg
Copy link

heshamg commented Dec 4, 2021

Setting "disable-hardware-acceleration": true in argv.json solved the problem for me. Otherwise there is very significant scrolling lag with python notebooks, even after clearing output of all cells.

Version: 1.62.3 (system setup)
Commit: ccbaa2d
Date: 2021-11-17T08:11:14.551Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

@oscarrutt
Copy link

heshamg When I set "disable-hardware-acceleration": true and relaunch, I get empty editor windows--nothing but title bar, status bar, and activity bar but with no icons. No tabs. The content area is blank. macOS 10.11.6. VSC 1.63.

@njbbaer
Copy link

njbbaer commented Jan 9, 2022

I'm experiencing the same slow scrolling as everyone else with Python notebooks in VSCode. I followed @heshamg's suggestion to use "disable-hardware-acceleration": true in argv.json which improves things considerably. @spuulis is also correct that it goes away if I shrink my window enough.

Version: 1.63.2
Commit: 899d46d
Date: 2021-12-15T09:39:46.686Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.11.0-43-generic

@rebornix rebornix modified the milestones: January 2022, Backlog Jan 27, 2022
@nikhilweee
Copy link

nikhilweee commented Mar 22, 2023

@njbbaer @heshamg How does one edit argv.json and where is this file located?
Update: Got it. Command Palette > Preferences: Configure Runtime Arguments

@seeM
Copy link

seeM commented Apr 11, 2023

@rebornix I'm experiencing sluggish scrolling in a notebook. Any chance you could help me out? I'm a huge fan of VSCode and use it for everything except notebooks atm because of this issue.

I've tried:

  • Running the latest insiders build
  • Running from CLI with --disable-renderer-accessibility and --disable-hardware-acceleration, and including them in argv.json
  • Opening a single notebook file (no folder) with 12 empty code/markdown cells and no outputs
  • Removing my external display
  • Disabling all extensions

Here is a performance profile while scrolling a few times: Profile-20230411T171625.json.zip

Version:          Code - Insiders 1.78.0-insider (761de52b5e297a8ea461dd501c897cc74c407733, 2023-04-11T05:26:19.957Z)
OS Version:       Darwin x64 22.3.0
CPUs:             Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz (4 x 3100)
Memory (System):  16.00GB (0.41GB free)
Load (avg):       14, 15, 12
VM:               0%
Screen Reader:    no
Process Argv:     --disable-renderer-accessibility --disable-hardware-acceleration --crash-reporter-id 3ed84550-7077-4565-8035-d1b65920fdaa
GPU Status:       2d_canvas:                              unavailable_software
                  canvas_oop_rasterization:               disabled_off
                  direct_rendering_display_compositor:    disabled_off_ok
                  gpu_compositing:                        disabled_software
                  metal:                                  disabled_off
                  multiple_raster_threads:                enabled_on
                  opengl:                                 disabled_off
                  rasterization:                          disabled_software
                  raw_draw:                               disabled_off_ok
                  video_decode:                           disabled_software
                  video_encode:                           disabled_software
                  vulkan:                                 disabled_off
                  webgl:                                  unavailable_software
                  webgl2:                                 unavailable_software
                  webgpu:                                 unavailable_software

@kimichenn
Copy link

I'm still experiencing slow scrolling in jupyter notebooks.
I've tried:

  • Setting "disable-hardware-acceleration": true
  • Using VSCode in windowed mode
  • Setting "editor.mouseWheelScrollSensitivity": 3 (it works for all files except jupyter notebooks)

I've seen other suggestions such as holding down alt to speed up the scrolling, but it doesn't work in jupyter notebooks for some reason.

Version: 1.80.1 (user setup)
Commit: 74f6148
Date: 2023-07-12T17:22:07.651Z
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

@alabamagan
Copy link

I'm still experiencing slow scrolling in jupyter notebooks. I've tried:

* Setting `"disable-hardware-acceleration": true`

* Using VSCode in windowed mode

* Setting `"editor.mouseWheelScrollSensitivity": 3` (it works for all files except jupyter notebooks)

I've seen other suggestions such as holding down alt to speed up the scrolling, but it doesn't work in jupyter notebooks for some reason.

Version: 1.80.1 (user setup) Commit: 74f6148 Date: 2023-07-12T17:22:07.651Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

alt + scroll works when your focus is within a code cell. When you scroll past it and let the window renders, the alt trick stops working. (as of version 1.87.2)

@spuulis
Copy link

spuulis commented Apr 6, 2024

Any progress on this issue? I have attempted the following, but the laggy scrolling still persists:

  • I did a clean reinstall of VSCode (as per this StackOverflow answer);
  • Disabled and uninstalled all extensions apart from the base Python and Jupyter extensions;
  • Set "disable-hardware-acceleration": true;
  • Connected to an external Jupyter server instead of letting VSCode create one for me.

I also noticed that I couldn't reproduce the lagginess in notebooks that contain only executed markdown cells. The lagginess appears if there is either

  • a visible unexecuted markdown cell,
  • a visible unexecuted code cell, or
  • a visible executed code cell.

It looks like the cells don't even have to be particularly complicated—a few empty code cells or cells with, for example, 1+1 written in them are enough for the lagginess to appear. The lagginess does, however, increase with an increase in the number of cells, but seems to be unaffected with whether I have connected to a Jupyter kernel or not.

As a final note, I want to reiterate that this issue only appears in Jupyter notebooks in VSCode. Plain text files in VSCode or other scrollable elements on my OS scroll just fine. This includes the JupyterLab web-based IDE on Safari where the scrolling is without issues.

Version: 1.88.0
Commit: 5c3e652
Date: 2024-04-03T13:28:18.899Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin x64 22.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues notebook-perf
Projects
None yet
Development

No branches or pull requests