jupyterlab-contrib / jlab-enhanced-cell-toolbar

A cell toolbar for JupyterLab.
BSD 3-Clause "New" or "Revised" License
41 stars 16 forks source link

Installing the extension cause the browser to hang for 30 to 60 seconds periodically #45

Open wkvolkman opened 2 years ago

wkvolkman commented 2 years ago

Description

I have installed the extension via pip recently into a fresh upgrade of Jupyter lab to 3.2.8 on Windows platform using python3.7. While working with the first 10 cells in a notebook everything seems to be fine. As I start working in cells beyond those first 10 the UI will freeze for seconds at a time and it freezes more frequently and longer as I am editing or working in around cell 30. If I scroll down to cell 100 or so it is like I cannot use my browser. Also the further down I get in a notebook it will stop putting the cell decorations on the cells. The browser (Firefox v 94) will throw up a dialog saying that the web page is slowing it down, do I want to stop it. I've uninstalled most of the other extensions trying to narrow it down and it was when I removed this extension that the problem stopped.

Reproduce

pip install jlab-enhanced-cell-toolbar jupyter lab build

## Expected behavior All cells render the toolbar and the browser remains responsive while working ## Context I cannot provide the specific information requested as it happens on a work machine and by security policy not allowed to share details.
fcollonval commented 2 years ago

Thanks for reporting @wkvolkman

Would you mind trying with those settings to see if it is still happening?

Go to menu Settings -> Advanced Settings Editor -> Notebook and in the right pane (User Preferences) paste the following:

{
    "renderCellOnIdle": false,
    "numberCellsToRenderDirectly": 10000000000000
}
wkvolkman commented 2 years ago

Well behavior has changed slightly. The initial workspace load takes minutes now instead of 10s of seconds, I have 7 work spaces with about 80 tabs each. Stepping through the cells in the notebook where I was having the most trouble I was able to execute 17 cells and then had a 20 second freeze of the UI. I stepped a couple of more cells without issue and then again a 20 second freeze (the browser dialog started to come up then left again). Moving between cells seems much slower. I'm heading to bed but will play around with it more tomorrow afternoon.

fcollonval commented 2 years ago

Thanks for testing - yes for a scenario like yours with lots of tabs open simultaneously this extension will make it even slower ( :sob: ) as it increases performance issue of JupyterLab.

wkvolkman commented 2 years ago

Well initially it seemed to help however later this afternoon the previous hanging for 30+ seconds returned. The overall drawing of updates is much slower with these settings. I do not know if it's related however the regular button bar at the top of the notebook vanished (and the debugger icon moved far left). On the right are ellipses which I have to click to see the old toolbar now flush right. Is there some javascript fu I should look for in the console or execute to aid with gathering information about this?

Update, I've gotten to 31 cells and jupyterlab has become unusable. Clicking on a cell takes almost a minute to focus and I've been able to type a whole line of input before it is echoed. Nice extension however I cannot use it.

fcollonval commented 2 years ago

JupyterLab has known performance issues when lots of documents are opened (or when a long notebook is). The behaviour you are seeing with the notebook toolbar itself is a bit weird because the ... button should be appearing only if the toolbar width is too small to contains all items. But I guess because the browser is having a hard time to recompute the layout, that feature is bringing troubles...

I'm working on those performance issues in core JupyterLab. But this is a long task. I'll post here when it is done later this year if you want to give another try at this extension :wink:

Thanks a lot for providing all those informations.