vscode-jupyter: New version of Jupyter notebook is extremely slow

Issue Type: Performance Issue

Recently I updated my jupyter notebook in vscode. I’'m glad that many jupyter features are supported in the nee version. However, I found that the execution of jupyter cells become extremely slow. I wrote some code to record the real execution time of my code. It turns out that the real execution time is not so long. But the time shown in the left-bottom cornor of jupyter cells are much longer than the real execution time. Sometime the reaction time is also exetremely slow, for example I pressed ‘Shift+Enter’ but it takes even one minute to start to execute the cell.

VS Code version: Code 1.59.0 (379476f0e13988d90fab105c5c19e7abc8b1dea8, 2021-08-04T23:13:12.822Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No Remote OS version: Linux x64 4.4.0-19041-Microsoft

System Info
Item Value
CPUs Intel® Core™ i5-6500 CPU @ 3.20GHz (4 x 3192)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.89GB (52.36GB free)
Process Argv –folder-uri=vscode-remote://wsl+Ubuntu/mnt/c/kfm/Computation --remote=wsl+Ubuntu --crash-reporter-id 608d2da6-c9b1-441b-a70e-018fd8f4ecf8
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 4.4.0-19041-Microsoft
CPUs Intel® Core™ i5-6500 CPU @ 3.20GHz (4 x 3192)
Memory (System) 63.89GB (52.36GB free)
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	   111	  4500	code main
    0	   100	  4528	   window (undefined)
    0	    86	  5460	   window (Issue Reporter)
    0	    27	  6552	   crashpad-handler
    0	   114	  7628	   window (undefined)
    0	   303	  9812	   gpu-process
    0	    90	 11504	   shared-process
    0	    66	 10288	     ptyHost
    0	    41	 11572	   utility
    1	   862	 13980	   window (● pprVO.ipynb - Computation [WSL: Ubuntu] - Visual Studio Code)
    0	   123	  8300	     extensionHost
    0	    65	  8232	       electron_node wslDaemon.js 
    0	     8	  1632	         C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 379476f0e13988d90fab105c5c19e7abc8b1dea8 stable .vscode-server 0  '
    0	    12	  5740	           console-window-host (Windows internal process)
    0	     8	 10688	           C:\WINDOWS\system32\lxss\wslhost.exe {a54a2b26-e418-4524-99ca-55fd4d1733f8} 508 516 520
    0	    14	 10432	             console-window-host (Windows internal process)

Remote: WSL: Ubuntu
CPU %	Mem MB	   PID	Process
    1	     0	   129	remote agent
    0	     0	   140	   ptyHost
    0	     0	   197	     /bin/bash
   19	     0	   166	   watcherService
   23	     0	   185	   extensionHost
    0	     0	   339	     /home/kfm/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8/node /home/kfm/.vscode-server/extensions/ms-python.vscode-pylance-2021.8.0/dist/server.bundle.js --cancellationReceive=file:d3dd6329a670fe53ae94e44c4b717a4a3d908af328 --node-ipc --clientProcessId=185
    0	     0	   411	     /home/kfm/Programs/anaconda3/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
    0	     0	   412	     /home/kfm/Programs/anaconda3/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
    0	     0	   413	     /home/kfm/Programs/anaconda3/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
    0	     0	   424	     /home/kfm/Programs/anaconda3/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
    0	     0	   426	       electron_node oMNPM.js 
    0	     0	   819	   /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	   820	     /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info

|  Remote: WSL: Ubuntu|    Folder (Computation): 10449 files|      File types: 1(1819) xsf(788) log(481) psf(368) cube(365) nc(364)
|                  fdf(322) xml(276) ion(273) xyz(210)
|      Conf files: settings.json(2);
Extensions (16)
Extension Author (truncated) Version
remote-ssh ms- 0.65.7
remote-ssh-edit ms- 0.65.7
remote-wsl ms- 0.58.2
material-icon-theme PKi 4.9.0
ayu tea 0.20.1
vscode-icons vsc 11.6.0
json-parse-validator Adr 1.1.2
vscode-ipython Che 0.6.2
nbpreviewer jit 1.2.2
linter-gfortran krv 2.3.0
MagicPython mag 1.1.0
python ms- 2021.8.1105858891
vscode-pylance ms- 2021.8.0
jupyter ms- 2021.8.1195043623
cpptools ms- 1.5.1
markdown-all-in-one yzh 3.4.0

(3 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805cf:30301675
pythonvspyt200:30340761
vscextlang:30333561
binariesv615:30325510
pythonvssor306:30344512
bridge0708:30335490
vstre464cf:30350173

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 16
  • Comments: 44 (21 by maintainers)

Most upvoted comments

Ok, so the delay is not in running a cell, but in starting the kernel. I.e. once you have run the first cell, running subsequent cells, such as 1+1 again doesn’t take 30seconds. is that correct?

Not really. Actually the case is the opposite. The first time I run “1+1” was very fast. The second time it took 30 seconds.

I also have the same issue, anyone knows how to fix this?

My jupyter is fine when running the first time. But after running several cells, it gets extremely slow. When I press “run”, it didn’t start to run until 10 or 20 seconds later. I also couldn’t interrupt the kernel, since interrupt/restart also gets very slow.

Another situation I noticed is that, if in my code cell, I accidentally write some typo, e.g., I used a variable/function that was never defined before, it gets extremely slow, and after a long time it will tell me that this variable/function is not defined; or I accidentally missed a “:” in the while loop, it will also take a long time to find this typo.

OS: Ubuntu 20.04.3 LTS (Focal Fossa) Python: 3.8.12 Python Extension: v2021.11.1422169775 Jupyter Extension: v2021.10.1001414422 VS code: 1.62.1

@DonJayamanne