Skip to content

Conversation

@brichet
Copy link
Contributor

@brichet brichet commented Apr 13, 2023

See #14366 for context.

References

Fixes #14366
The issue was first notified in jupyter/notebook#6838

Code changes

Adds a signal in ToolbarWidgetRegistry, which is emitted when an item factory is added to the registry.
This signal is caught by the toolbarFactory to render again the widget.

User-facing changes

None

Backwards-incompatible changes

None

EDIT:
Tested successfully on jupyter/notebook#6838

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @brichet I think there is a small typo but otherwise it looks good.

expect(factory2(new Widget())).toHaveLength(3);
});

it('should update the toolbar items with late item factory', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
@jtpio
Copy link
Member

jtpio commented Apr 14, 2023

Thanks @brichet!

Wondering if there could be other situations than just toolbar items that could be affected by this new caching logic of the settings?

@brichet
Copy link
Contributor Author

brichet commented Apr 14, 2023

Wondering if there could be other situations than just toolbar items that could be affected by this new caching logic of the settings?

This is hard to say, this is really an indirect effect, and there is probably no test on that behavior.
Actually, we were lucky it worked without trouble until now. It is likely that adding dependencies on other plugins with long loading times could have produced the same issue.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @brichet

@github-actions
Copy link
Contributor

Benchmark report

The execution time (in milliseconds) are grouped by test file, test type and browser.
For each case, the following values are computed: min <- [1st quartile - median - 3rd quartile] -> max.

The mean relative comparison is computed with 95% confidence.

Results table
Test file large_code_notebook large_md_notebook
open
chromium
actual 502 <- [565 - 596 - 618] -> 719 642 <- [1148 - 1195 - 1253] -> 1374
expected 503 <- [548 - 586 - 626] -> 796 645 <- [1138 - 1183 - 1238] -> 1402
Mean relative change 0.7% ± 2.4% 1.4% ± 4.0%
switch-from
chromium
actual 560 <- [648 - 665 - 692] -> 758 299 <- [354 - 381 - 406] -> 510
expected 530 <- [640 - 655 - 678] -> 888 308 <- [345 - 372 - 395] -> 450
Mean relative change 1.4% ± 2.0% 3.2% ± 2.7%
switch-to
chromium
actual 1073 <- [1141 - 1162 - 1192] -> 1337 756 <- [823 - 836 - 850] -> 891
expected 1085 <- [1131 - 1149 - 1173] -> 1554 741 <- [800 - 817 - 831] -> 904
Mean relative change 0.7% ± 1.4% 2.2% ± 0.9%
close
chromium
actual 142 <- [151 - 157 - 165] -> 202 196 <- [207 - 210 - 217] -> 333
expected 134 <- [146 - 151 - 156] -> 186 187 <- [201 - 205 - 212] -> 242
Mean relative change 4.6% ± 1.9% 3.3% ± 1.9%

Changes are computed with expected as reference.

@jupyterlab/benchmarks@1.0.0 test:mocha
mocha ./tests/

Waiting for localhost:8888
localhost:8888 is up

Cell memory leaks

Create a code cell Memory change: +155 kB Leak detected: Yes

Leaking objects:

Object # added Retained size increase
ArraySearchMarker 1 +5 B
ContentDeleted 1 +16 B
ContentString 1 +69 B
Detached Text 1 +79 B
FocusTracker 1 +276 B
ObservableList 1 +60 B
OutputArea 1 +1.4 kB
OutputAreaModel 1 +115 B
Promise 1 +20 B
PromiseDelegate 1 +128 B
ResizeHandle 1 +47 B
RestorablePool 1 +304 B
UndoManager 1 +1.93 kB
WidgetTracker 1 +976 B
YArray 1 +164 B
YCodeCell 1 +107 B
YText 1 +40 B
Detached DOMStringMap 2 +100 B
Detached V8EventHandlerNonNull 2 +80 B
Set 2 +1.21 kB
YMap 2 +464 B
StackItem 3 +1.32 kB
ContentAny 4 +207 B
ContentType 4 +64 B
DeleteItem 4 +80 B
DeleteSet 6 +988 B
Detached HTMLCollection 6 +588 B
EventHandler 8 +250 B
ID 10 +320 B
Item 10 +1.17 kB
Detached DOMTokenList 13 +880 B
Detached Attr 14 +1.12 kB
Detached HTMLDivElement 14 +47 kB
Map 17 +2.57 kB
Signal 19 +319 B
Array 44 +5.69 kB
Detached V8EventListener 263 +23.4 kB
Detached EventListener 265 +42.6 kB
(closure) 270 +27 kB
Detached InternalNode 323 +45.3 kB

Leaking collections:

Type Change Preview Size increased at
Array +2 [StackItem, ...]
UndoManager.afterTransactionHandler  http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5064:15
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.forEach <anonymous>
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.<anonymous> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4720:27
webpack://jupyterlab/node_modules/lib0/function.js:19:0
cleanupTransactions http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4722:62
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4843:9
Doc.transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2050:5
Array +10 [Item, ...]
addStruct                    http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4295:11
Item.integrate http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:11118:7
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6651:22
Array.forEach <anonymous>
typeListInsertGenericsAfter http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6624:11
typeListInsertGenerics http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6711:10
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7039:9
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4829:14
YArray.insert http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7038:7
Set +1 Set((anonymous function), ...)
                          webpack://jupyterlab/node_modules/lib0/observable.js:30:56                                                                                     
Doc.on http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2209:11
new UndoManager http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5084:14
YCodeCell.setUndoManager http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:398:33
<unknown> http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1589:15
Array.forEach <anonymous>
YNotebook.insertCells http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1588:16
YNotebook.insertCell http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1569:21
webpack://jupyterlab/packages/notebook/src/actions.tsx:405:22
Create a markdown cell Memory change: -96.5 kB Leak detected: No

Leaking objects:

Object # added Retained size increase
ActivityMonitor 1 +294 B
ArraySearchMarker 1 +5 B
AttachmentsModel 1 +193 B
AttachmentsResolver 1 +14 B
CodeCellModel 1 +359 B
ContentString 1 +66 B
Debouncer 1 +3.46 kB
Detached HTMLAnchorElement 1 +316 B
Detached HTMLButtonElement 1 +5.32 kB
Detached HTMLHeadingElement 1 +1.04 kB
Error 1 +3.06 kB
MarkdownCell 1 +4.73 kB
MarkdownCellModel 1 +237 B
Poll 1 +3.7 kB
RenderMimeRegistry 1 +227 B
RenderedMarkdown 1 +66 B
Transaction 1 +860 B
TypeError 1 +306 B
YArray 1 +164 B
YArrayEvent 1 +357 B
YCodeCell 1 +107 B
YMarkdownCell 1 +45 B
Detached CSSStyleDeclaration 2 +132 B
Detached HTMLElement 2 +336 B
Detached V8EventHandlerNonNull 2 +5.04 kB
Promise 2 +3.06 kB
PromiseDelegate 2 +3.27 kB
UndoManager 2 +2.38 kB
YText 2 +490 B
Detached DOMStringMap 3 +144 B
ObservableMap 3 +381 B
StackItem 3 +1.33 kB
DeleteItem 4 +80 B
YMap 4 +872 B
ContentAny 5 +454 B
DeleteSet 6 +1 kB
ContentType 7 +112 B
Detached Text 7 +532 B
Set 8 +1.76 kB
Detached HTMLDivElement 10 +30.7 kB
Detached DOMTokenList 13 +852 B
ID 13 +416 B
Item 13 +1.71 kB
EventHandler 14 +459 B
Detached HTMLCollection 17 +1.77 kB
Map 27 +12.2 kB
Signal 28 +722 B
Detached V8EventListener 130 +10.9 kB
Detached EventListener 132 +25.5 kB
(closure) 152 +29.6 kB
Detached InternalNode 162 +28.4 kB

Leaking collections:

Type Change Preview Size increased at
Array +1 [cc1ec53a-82e8-4ab3-a34f-57d518a9b91f, ...]
                                     webpack://jupyterlab/packages/notebook/src/actions.tsx:2507:37            
Array.forEach <anonymous>
webpack://jupyterlab/packages/notebook/src/actions.tsx:2502:21
webpack://jupyterlab/packages/notebook/src/actions.tsx:351:12
webpack://jupyterlab/packages/notebook-extension/src/index.ts:2653:15
CommandRegistry.execute http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5748:33
CommandRegistry._executeKeyBinding http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5906:14
CommandRegistry.processKeydownEvent http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5846:18
JupyterLab.evtKeydown http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:4660:23
Array +1 [{signal, slot, thisArg}, ...]
Object.connect  http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10491:17
Signal.connect http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10231:24
webpack://jupyterlab/packages/notebook/src/notebooktools.ts:226:33
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Signal.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10257:17
webpack://jupyterlab/packages/notebook/src/tracker.ts:90:30
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Array +1 [{signal, slot, thisArg}, ...]
Object.connect  http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10491:17
Signal.connect http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10231:24
webpack://jupyterlab/packages/cell-toolbar/src/celltoolbartracker.ts:121:37
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Signal.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10257:17
webpack://jupyterlab/packages/notebook/src/widget.ts:1338:30
webpack://jupyterlab/packages/notebook/src/actions.tsx:409:28
webpack://jupyterlab/packages/notebook-extension/src/index.ts:2722:15
Array +2 [StackItem, ...]
UndoManager.afterTransactionHandler  http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5064:15
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.forEach <anonymous>
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.<anonymous> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4720:27
webpack://jupyterlab/node_modules/lib0/function.js:19:0
cleanupTransactions http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4722:62
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4843:9
Doc.transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2050:5
Array +13 [Item, ...]
addStruct                    http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4295:11
Item.integrate http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:11118:7
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6651:22
Array.forEach <anonymous>
typeListInsertGenericsAfter http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6624:11
typeListInsertGenerics http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6711:10
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7039:9
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4829:14
YArray.insert http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7038:7
Set +2 Set((anonymous function), ...)
                          webpack://jupyterlab/node_modules/lib0/observable.js:30:56                                                                                     
Doc.on http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2209:11
new UndoManager http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5084:14
YCodeCell.setUndoManager http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:398:33
<unknown> http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1589:15
Array.forEach <anonymous>
YNotebook.insertCells http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1588:16
YNotebook.insertCell http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1569:21
webpack://jupyterlab/packages/notebook/src/actions.tsx:405:22
Create a raw cell Memory change: -170 kB Leak detected: No

Leaking objects:

Object # added Retained size increase
ArraySearchMarker 1 +5 B
CodeCellModel 1 +217 B
ContentString 1 +690 B
Detached CSSStyleDeclaration 1 +68 B
Detached V8EventHandlerNonNull 1 +40 B
ObservableMap 1 +109 B
TypeError 1 +306 B
YArray 1 +164 B
YCodeCell 1 +107 B
YRawCell 1 +45 B
Detached DOMStringMap 2 +100 B
Set 2 +1.33 kB
UndoManager 2 +2.38 kB
YText 2 +490 B
StackItem 3 +1.33 kB
DeleteItem 4 +80 B
YMap 4 +872 B
ContentAny 5 +454 B
Detached HTMLCollection 5 +488 B
DeleteSet 6 +1 kB
ContentType 7 +112 B
Detached DOMTokenList 9 +604 B
Detached HTMLDivElement 9 +22.7 kB
Signal 11 +356 B
ID 13 +416 B
Item 13 +2.34 kB
EventHandler 14 +459 B
Map 19 +11.6 kB
Object 35 +188 kB
Detached V8EventListener 130 +10.9 kB
Detached EventListener 131 +20.4 kB
(closure) 140 +8.12 kB
Detached InternalNode 151 +21.7 kB

Leaking collections:

Type Change Preview Size increased at
Array +1 [{signal, slot, thisArg}, ...]
Object.connect  http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10491:17
Signal.connect http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10231:24
webpack://jupyterlab/packages/notebook/src/notebooktools.ts:226:33
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Signal.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10257:17
webpack://jupyterlab/packages/notebook/src/tracker.ts:90:30
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Array +1 [0f28b083-1c28-4eef-81c1-d987d646b4d0, ...]
                                     webpack://jupyterlab/packages/notebook/src/actions.tsx:2507:37            
Array.forEach <anonymous>
webpack://jupyterlab/packages/notebook/src/actions.tsx:2502:21
webpack://jupyterlab/packages/notebook/src/actions.tsx:351:12
webpack://jupyterlab/packages/notebook-extension/src/index.ts:2653:15
CommandRegistry.execute http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5748:33
CommandRegistry._executeKeyBinding http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5906:14
CommandRegistry.processKeydownEvent http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:5846:18
JupyterLab.evtKeydown http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:4660:23
Array +1 [{signal, slot, thisArg}, ...]
Object.connect  http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10491:17
Signal.connect http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10231:24
webpack://jupyterlab/packages/cell-toolbar/src/celltoolbartracker.ts:121:37
invokeSlot http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10700:18
Object.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10658:17
Signal.emit http://localhost:8888/static/lab/jlab_core.912f2b7e2a9f04feb210.js:10257:17
webpack://jupyterlab/packages/notebook/src/widget.ts:1338:30
webpack://jupyterlab/packages/notebook/src/actions.tsx:409:28
webpack://jupyterlab/packages/notebook-extension/src/index.ts:2722:15
Array +2 [StackItem, ...]
UndoManager.afterTransactionHandler  http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5064:15
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.forEach <anonymous>
webpack://jupyterlab/node_modules/lib0/observable.js:73:62
Array.<anonymous> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4720:27
webpack://jupyterlab/node_modules/lib0/function.js:19:0
cleanupTransactions http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4722:62
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4843:9
Doc.transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2050:5
Array +13 [Item, ...]
addStruct                    http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4295:11
Item.integrate http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:11118:7
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6651:22
Array.forEach <anonymous>
typeListInsertGenericsAfter http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6624:11
typeListInsertGenerics http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:6711:10
<unknown> http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7039:9
transact http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:4829:14
YArray.insert http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:7038:7
Set +2 Set((anonymous function), ...)
                          webpack://jupyterlab/node_modules/lib0/observable.js:30:56                                                                                     
Doc.on http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:2209:11
new UndoManager http://localhost:8888/static/lab/vendors-node_modules_yjs_dist_yjs_mjs.7c22fc794e51ffbd0e42.js:5084:14
YCodeCell.setUndoManager http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:398:33
<unknown> http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1589:15
Array.forEach <anonymous>
YNotebook.insertCells http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1588:16
YNotebook.insertCell http://localhost:8888/static/lab/vendors-node_modules_jupyter_ydoc_lib_index_js-node_modules_process_browser_js.a4c17770813817b2b11a.js:1569:21
webpack://jupyterlab/packages/notebook/src/actions.tsx:405:22
- Drag and drop a cell

File editor memory leaks

Create a file Memory change: -79.2 kB Leak detected: No

Leaking objects:

Object # added Retained size increase
Detached HTMLUListElement 1 +3.43 kB
Detached V8EventHandlerNonNull 1 +40 B
VirtualElementPass 1 +46 B
Detached ElementIntersectionObserverData 2 +144 B
Detached HTMLButtonElement 2 +23.9 kB
Detached SVGCircleElement 2 +1.12 kB
LabIcon 2 +1.08 kB
Detached CSSStyleDeclaration 3 +224 B
Detached HTMLLIElement 3 +6.38 kB
Detached NodeList 3 +188 B
NavigationHistoryEntry 3 +720 B
VirtualText 3 +109 B
Detached SVGGElement 4 +3 kB
VirtualElement 4 +2.48 kB
Detached SVGAnimatedPreserveAspectRatio 5 +320 B
Detached SVGAnimatedRect 5 +320 B
Detached SVGPathElement 5 +1.81 kB
Detached SVGSVGElement 5 +8.14 kB
Detached HTMLSpanElement 6 +2.34 kB
Detached DOMStringMap 7 +404 B
Detached SVGAnimatedNumber 7 +448 B
Detached Attr 10 +800 B
Detached Text 10 +1.07 kB
Detached HTMLCollection 13 +1.42 kB
Detached DOMTokenList 14 +884 B
Detached HTMLDivElement 15 +34.1 kB
Detached SVGAnimatedString 16 +896 B
Detached SVGAnimatedTransformList 16 +1.02 kB
Detached SVGAnimatedLength 26 +1.66 kB
Array 42 +25 kB
Detached V8EventListener 130 +10.9 kB
Detached EventListener 131 +20.4 kB
(closure) 138 +20.5 kB
✔ Opening a text file (68149ms)

Notebook memory leaks

Create a notebook Memory change: +30.6 kB Leak detected: Yes

Leaking objects:

Object # added Retained size increase
Detached HTMLUListElement 1 +2.42 kB
Detached V8EventHandlerNonNull 1 +40 B
VirtualElementPass 1 +55 B
Detached ElementIntersectionObserverData 2 +144 B
Detached HTMLButtonElement 2 +24 kB
Detached SVGCircleElement 2 +1.12 kB
HTMLDivElement 2 +163 B
LabIcon 2 +80 B
Detached CSSStyleDeclaration 3 +236 B
Detached HTMLLIElement 3 +6.37 kB
Detached NodeList 3 +192 B
NavigationHistoryEntry 3 +720 B
VirtualText 3 +110 B
VirtualElement 4 +1.15 kB
Detached SVGAnimatedPreserveAspectRatio 5 +320 B
Detached SVGAnimatedRect 5 +320 B
Detached SVGSVGElement 5 +9.44 kB
Detached HTMLSpanElement 6 +3.19 kB
Detached SVGGElement 6 +5.02 kB
Detached SVGPathElement 7 +2.53 kB
Detached SVGAnimatedNumber 9 +576 B
Detached Attr 10 +800 B
Detached Text 10 +836 B
Detached HTMLCollection 13 +1.46 kB
Detached DOMTokenList 15 +1.05 kB
Detached HTMLDivElement 15 +33.9 kB
Detached SVGAnimatedString 20 +1.12 kB
Detached SVGAnimatedTransformList 20 +1.28 kB
Array 21 +24.2 kB
Detached SVGAnimatedLength 26 +1.66 kB
Object 59 +193 kB
Detached V8EventListener 130 +10.9 kB
Detached EventListener 131 +20.4 kB
(closure) 138 +39.9 kB

1 passing (7m)
1 pending
2 failing

   Adding a cell:

  Create a code cell - Objects leaking
  + expected - actual

  -1322
  +1308
  
  at file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:43:16
  at Array.forEach (<anonymous>)
  at expectNoLeaks (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:28:11)
  at testScenario (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:230:3)
  at async Context.<anonymous> (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/cell.test.mjs:7:5)


   Opening a notebook:

  Create a notebook - Objects leaking
  + expected - actual

  -683
  +672
  
  at file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:43:16
  at Array.forEach (<anonymous>)
  at expectNoLeaks (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:28:11)
  at testScenario (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/utils.mjs:230:3)
  at async Context.<anonymous> (file:///home/runner/work/_actions/jupyterlab/benchmarks/v1/memory-leaks/tests/notebook.test.mjs:6:5)

@fcollonval fcollonval merged commit 9c9bc56 into jupyterlab:master Apr 14, 2023
@brichet brichet deleted the fix/toolbarRegistry branch April 19, 2023 16:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JupyterLab 4.0.0b1 breaks Notebook 7 TopBar items

3 participants