microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 293 forks source link

ipynb notebook speed in VSCode vs browser based Jupyter #11297

Closed BAI-adam closed 1 year ago

BAI-adam commented 2 years ago

Applies To

What happened?

Running an ipynb in VSCode extremely slow (unable to provide code, but notebook was reading files, processing, and writing files to a local folder in the same directory as the notebook).

In VSCode, cell was running for >2h taking about 5 min to process each file (files are less than 5MB each, so not a memory issues). Running this in a browser based notebook took ~5mins TOTAL to process everything.

VSCode had just updated when I started working today, so could be related to this.

VS Code Version

1.71.0

Jupyter Extension Version

v2022.9.1002511105

Jupyter logs

No response

Coding Language and Runtime Version

Python 3.7

Language Extension Version (if applicable)

Python extension

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

DonJayamanne commented 2 years ago

I'm sorry you're running into this issue, please could you provide some more information that would help us diagnose this issue. please could you upload the logs from the Jupyter output panel, you can get there output using the command Jupyter: Show Output. Please remember to copy and upload all of the output.

AlFontal commented 2 years ago

I am also seeing way slower performances in VS Code compared to browser based Jupyter, specifically when working with GeoDataFrames and decently-sized Shapefiles. Once these are loaded in memory, any simple operation becomes painfully slow, to the point of making it impossible to work like that.

I suspect this might have to do with the built-in variable explorer?

DonJayamanne commented 2 years ago

@AlFontal

seeing way slower performances in VS Code compared to browser based Jupyter,

I'd like to understand what you mean by slow performance. Are you referring to editing, navigating through the notebook/cells or editing code in the cells. Or is this performance related to execution of cells in the notebook?

Would you be able to upload such a file or email it to me <don>.<jayamanne> at the company i work for. Please do list the dependencies to be installed as well. thanks

AlFontal commented 2 years ago

@DonJayamanne

Editing and navigating through notebook/cells works perfectly, no issues there. By slow performance I mean the execution of cells in the notebook.

Computationally cheap cells execute in mili-seconds in the browser and in seconds within VS Code, while expensive computations often take ~2/3x the time in VS Code as in the browser.

I am running VS Code locally, on Ubuntu 20.04, with a poetry env using python 3.8.10 and the issue happens both when the kernel is started within VS Code or when starting a jupyter kernel in the terminal and manually inputting it.

I will try and do a small toy example to reproduce the errors side by side.

DonJayamanne commented 2 years ago

small toy example to reproduce the errors side by side

thanks that would help. specially having some sample code that we can try at our end as well.

DonJayamanne commented 1 year ago

Closing this issue as its been over 4 weeks, since the information was requested. We'll be happy to reopen the issue when the requested information has been provided.