Review main Merged

77750[BUGFIX] Improve performance of TreeController

Alexander Grein CR +2 V +2 Easy +27 −22 updated 03/28/23, 10:36

Commit message

The recursive function pagesToFlatArray make use of
the page tree repository on two places, which always
instantiates the same object. To improve the performance
this patch instantiates the page tree only once and stores
it in a protected property.

Moreover, it adds another protected property
editPageAndDefaultLanguageAccess, which holds the general
allowance of a backend user to modify pages and access to
the default language. This information is needed in the
pagesToFlatArray as well and was requested over and over
again.

Finally, the array_merge construction inside fetchDataAction
and filterDataAction was changed to a more performant solution,
by merging it after the loop.
Overall, this reduces the request time of a page tree ajax
call (data and filter) for around 10%.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Benni Mack +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1524

  1. Alexander Grein uploaded patch set 1 02/07/23, 11:21

  2. core-ci voted on patch set 1 V -1 02/07/23, 11:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37277

  3. core-ci commented on patch set 1 02/07/23, 12:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37277

  4. Alexander Grein uploaded patch set 2 V -1 02/07/23, 14:40

  5. core-ci voted on patch set 2 V +1 02/07/23, 14:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37294

  6. Alexander Grein updated the commit message in patch set 3 V +1 02/07/23, 19:17

  7. core-ci voted on patch set 3 V +1 02/07/23, 19:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37311

  8. Georg Ringer commented on patch set 3 CR -1 02/07/23, 20:02

    TreeController.php:125

    that shouldnt be changed, less quality - no reason IMO

    TreeController.php:462

    maybe this should be then a initializePageTreeRepository, called in the constructor? using void, and just init the $pageTreeRepository
  9. Alexander Grein uploaded patch set 4 CR -1 V +1 02/07/23, 21:16

  10. core-ci voted on patch set 4 V +1 02/07/23, 21:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37317

  11. Josef Glatz uploaded patch set 5 V +1 02/08/23, 14:29

  12. core-ci voted on patch set 5 V +1 02/08/23, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37381

  13. Alexander Grein updated the commit message in patch set 6 V +1 02/08/23, 16:16

  14. core-ci voted on patch set 6 V +1 02/08/23, 16:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37387

  15. Benni Mack uploaded patch set 7 V +1 02/08/23, 17:44

  16. Benni Mack commented on patch set 7 CR +1 02/08/23, 17:45

    I hope you don't mind that I changed a few things...
  17. core-ci voted on patch set 7 V -1 02/08/23, 18:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37395

  18. Benni Mack uploaded patch set 8 CR +1 V -1 02/08/23, 21:15

  19. Benni Mack voted on patch set 8 V +1 CR +1 02/08/23, 21:15

  20. core-ci voted on patch set 8 V +1 02/08/23, 21:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37412

  21. Andreas Kienast commented on patch set 8 CR -1 02/09/23, 10:08

    reviewing...
  22. Andreas Kienast voted on patch set 8 V +2 CR +2 02/09/23, 10:27

  23. Andreas Kienast merged patch set 9 02/09/23, 10:28

  24. Stephan Großberndt commented on patch set 9 03/28/23, 10:36

    Backport to 11.5 is still missing.

    TreeController.php:125 Reply

    Done

    TreeController.php:462 Reply

    Done