LL perf (Inventory): Folder delete is quadratic #339

Closed
opened 2026-10-04 14:09:23 +00:00 by sky_line · 1 comment
Owner

From the LL-origin inefficiency audit (finding I3). File/line references are from commit 0229f8872c; re-locate them before working.

Folder delete is quadratic

  • Recursion: LLFolderViewFolder::isRemovable (llui/llfolderviewitem.cpp:2003-2029) runs get_is_category_and_children_removable (a full collectDescendents plus a COF walk) at every level.
  • More walks: removeBatch repeats isItemRemovable 5 times per element (llinventorybridge.cpp:465-574).
  • Bug: descendent_categories/descendent_items (:457-458) are never cleared between folders, so gestures from earlier folders are re-deactivated, with duplicate messages.
  • Pointless self-copy: updateItem per item after moveObject (:613-621).
  • Trash count by full walk: checkTrashOverflow walks the entire trash to count it after every delete (llinventorymodel.cpp:4307-4335).
  • Fix: one removability walk per batch; scope the arrays; counting functor.
  • Confirmed. M.

Verify the cost (profile or timer) before and after changing it.

From the LL-origin inefficiency audit (finding I3). File/line references are from commit 0229f8872c; re-locate them before working. **Folder delete is quadratic** - **Recursion:** `LLFolderViewFolder::isRemovable` (`llui/llfolderviewitem.cpp:2003-2029`) runs `get_is_category_and_children_removable` (a full `collectDescendents` plus a COF walk) at every level. - **More walks:** `removeBatch` repeats `isItemRemovable` 5 times per element (`llinventorybridge.cpp:465-574`). - **Bug:** `descendent_categories`/`descendent_items` (`:457-458`) are never cleared between folders, so gestures from earlier folders are re-deactivated, with duplicate messages. - **Pointless self-copy:** `updateItem` per item after `moveObject` (`:613-621`). - **Trash count by full walk:** `checkTrashOverflow` walks the entire trash to count it after every delete (`llinventorymodel.cpp:4307-4335`). - **Fix:** one removability walk per batch; scope the arrays; counting functor. - Confirmed. M. Verify the cost (profile or timer) before and after changing it.
sky_line added this to the Slipstream project 2026-10-06 15:04:14 +00:00
Author
Owner

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).
sky_line 2026-10-11 13:24:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#339
No description provided.