91284[BUGFIX] Improve pagetree performance
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Andreas Nedbal +1
- Josua Vogel +1
- Benjamin Kott +1
- Ayke Halder +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Andreas Nedbal +1
- Josua Vogel +1
- Benjamin Kott +1
- core-ci +1 CI
Issues 1
Files 4
Review log 1420
-
Benjamin Franzke uploaded patch set 1 10/27/25, 17:59
-
core-ci voted on patch set 1 V -1 10/27/25, 18:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87705
-
Benjamin Franzke uploaded patch set 2
V -110/27/25, 18:28 -
core-ci voted on patch set 2 V -1 10/27/25, 18:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87713
-
Benjamin Franzke uploaded patch set 3
V -110/27/25, 20:18 -
core-ci voted on patch set 3 V -1 10/27/25, 20:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87734
-
Benjamin Franzke uploaded patch set 4
V -110/28/25, 09:52 -
core-ci voted on patch set 4 V +1 10/28/25, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87786
-
Benjamin Franzke uploaded patch set 5
V +110/28/25, 10:30 -
core-ci voted on patch set 5 V +1 10/28/25, 10:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87789
-
Benjamin Franzke uploaded patch set 6
V +110/28/25, 11:02 -
Benjamin Kott voted on patch set 6 CR +1 V +1 10/28/25, 11:16
-
core-ci voted on patch set 6 V +1 10/28/25, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87801
-
Andreas Nedbal commented on patch set 6 CR +1 V +1 10/28/25, 11:40
Works great! Also verified because I was working on the exact same issue right now and came to basically the same conclusion :D -
Josua Vogel commented on patch set 6 CR +1 V +1 10/28/25, 11:45
Works in our customer project. It performs much better. If a large number of pages are open, there is still a very slight delay (milliseconds) , but this should not cause any problems. Thank you very much for the fix! Awesome job! -
Benjamin Franzke voted on patch set 6 CR +2 V +2 10/28/25, 11:46
-
Benjamin Franzke merged patch set 7 10/28/25, 11:48
-
Ayke Halder commented on patch set 7 CR +1 10/28/25, 14:56
tree.ts:48I like! 🙌tree.ts:500Nice one here, removing the expensive calls to `this.nodes.find()` 👍 See https://review.typo3.org/c/Packages/TYPO3.CMS/+/88227/comments/4f0bb02e_c9dc1d18 > 2) Object-storage of the tree-nodes is implemented as array > > The tree-nodes don't know their parents, resulting in complex calculations to find the parent each time when there is a tree change. > > On tree-rendering the function getParentNode calls getNodeByTreeIdentifier which calls this.nodes.find(…) inside an iterative loop. > > Time used to find parents is around 30 ms total on opening/closing any sub-tree. > > I think Big-O complexity of the calculation is O(n^(m²)) > with n: number of visible nodes (~20-30) > and m: depth of tree (3-4). > > By storing each child-node with a reference to its parent node, the time of searching for parents can be reduced from O(n^(m²)) [30 ms] to O(n) [2-3 ms]. -
Garvin Hicking commented on patch set 7 10/28/25, 15:19
thanks so much for investigating and addressing this. I think you made some people very happy! -
Ayke Halder commented on patch set 7 11/13/26, 08:09
Unresolved
Some further performance improvement I got in mind here.tree.ts:429UnresolvedThis might be refactored and the order reversed: 1. First create `TreeNodeMap` 2. Then use this very `TreeNodeMap` to implement a fast implementation for `this.enhanceNodes(nodes)` Background: * `this.enhanceNodes` runs in a loop over each node using `nodes.reduce()` and then calls `findLast()` to get the praent node of each node! * Getting the parent node fast, is what this `TreeNodeMap` is all about.tree.ts:562Unresolved`findLast()` is computational expensive - and is run inside a loop `nodes.reduce()`.