Fix: Prevent Inspector UI freeze by lazy loading allChildren#40
Conversation
|
In pharo the protocol allX and withAllX are codified.
So we should follow this semantics. Now if the inspector is slow then we should change something else :) |
|
There is one test that is not passing. Could you fix it? CTAVLTreeInspectorTest |
|
Yea, That test is failing because my commit changed the semantics of As I mentioned in the plan above, my next commit reverts |
|
yes please push all the commits here |
|
|
||
| { #category : '*Containers-AVL-Tree-Inspector' } | ||
| CTAVLTree >> inspectorCanvas: aBuilder [ | ||
| CTAVLTree >> allChildren [ |
There was a problem hiding this comment.
the CI is failing because this method should be in the Containers-ALV-Tree package and not in the Containers-ALV-Tree-Inspector.
Now this method is an extension, it should be not. Could you change that please? If you need more info about what the problem is write me on Discord



Fixes #39
This PR fixes the massive memory allocation and UI-freezing bug in the AVL Tree inspector by replacing the full-tree BFS with a lazy-loading structural approach.
Changes:
CTAVLTree >> allChildrento only return the root node.allChildrenintoCTAVLNode(via*Containers-AVL-Tree-Inspectorextension protocol) to return only its immediateleftandrightchildren usingArray streamContents:.allChildrenintoCTAVLNilNodeto return an empty array.testAllChildreninCTAVLTreeTestto assert against the new lazy-loading expected behavior instead of a full tree dump.Video Proof of Fix:
(Running the exact same 200,000 node stress-test script from Issue #39)
Screencast.From.2026-02-28.00-05-15.mp4
Result:
The Pharo Inspector is designed to be hierarchical. By returning only the immediate children, the Inspector can unfold the tree incrementally. Inspecting a tree with 200,000+ nodes is now instantaneous and uses O(1) memory overhead per click, completely eliminating the Garbage Collection freeze.