Review main Abandoned

78045[TASK] Improve performance of IRRE records in Backend Forms

Christian Eßl CR -1 V 0 Normal +69 −97 updated 11/12/26, 18:59

Commit message

By utilizing the runtime cache, several superfluous queries,
that were always querying the same parent records, are now
avoided, improving the performance of Backend Forms, when
having many inline relations attached to a record.

The following changes were made:
- Avoid always querying the same parent record in
AbstractDatabaseRecordProvider by using a runtime cache.
- Avoid always querying the same language overlays for a
parent record in DatabasePageLanguageOverlayRows by
using a runtime cache.
- Use a runtime cache to fetch the page permissions for
the same page only once in both FileReferenceContainer
and InlineRecordContainer.

Review

  • Code review CR -1
    • Christian Kuhn -1
  • Verified V 0
    • core-ci +1 CI

Issues 1

Files 13

Review log 2332

Show 57 earlier messages
  1. Christian Eßl uploaded patch set 1 03/07/23, 12:23

  2. core-ci voted on patch set 1 V -1 03/07/23, 13:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38595

  3. Christian Eßl uploaded patch set 2 V -1 03/07/23, 13:11

  4. Oliver Klee commented on patch set 2 03/07/23, 13:14

    FileReferenceContainer.php:546

    Is this a new cache? If so, please use the new xxh3 algorithm - it's a lost faster. (Some numbers: https://php.watch/articles/php-hash-benchmark) On second thought: Do we need a hash here in the first place? Or would appending the parent UID suffice?

    InlineRecordContainer.php:556

    At a first glance, this looks like duplicated code to the other class. Can we avoid the duplication?
  5. core-ci voted on patch set 2 V +1 03/07/23, 13:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38598

  6. Christian Eßl uploaded patch set 3 V +1 03/07/23, 13:23

  7. Christian Eßl uploaded patch set 4 03/07/23, 13:25

  1. Christian Eßl commented on patch set 2 03/07/23, 13:25

    ack
  2. core-ci voted on patch set 3 V -1 03/07/23, 13:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38601

  3. core-ci voted on patch set 4 V +1 03/07/23, 13:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38602

  4. Georg Ringer commented on patch set 4 03/08/23, 19:35

    FileReferenceContainer.php:544

    this comment belongs to the method

    FileReferenceContainer.php:546

    this is not a hash but now an $identifier

    InlineRecordContainer.php:556 Reply

    we could move it to the abstractcontainer

    AbstractDatabaseRecordProvider.php:73

    remove comment, imo not needed

    AbstractDatabaseRecordProvider.php:75

    do we need the hash? can be avoided i guess

    DatabasePageLanguageOverlayRows.php:54

    remove comment

    DatabasePageLanguageOverlayRows.php:56

    $identifier
  5. Christian Eßl uploaded patch set 5 V +1 03/09/23, 18:31

  6. Christian Eßl commented on patch set 4 03/09/23, 18:31

    FileReferenceContainer.php:544 Reply

    Done

    FileReferenceContainer.php:546 Reply

    Done

    InlineRecordContainer.php:556 Reply

    Done

    AbstractDatabaseRecordProvider.php:73 Reply

    Done

    AbstractDatabaseRecordProvider.php:75 Reply

    Done

    DatabasePageLanguageOverlayRows.php:54 Reply

    Done

    DatabasePageLanguageOverlayRows.php:56 Reply

    Done
  7. core-ci voted on patch set 5 V -1 03/09/23, 19:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38715

  8. Christian Eßl uploaded patch set 6 V -1 03/09/23, 19:58

  9. core-ci voted on patch set 6 V -1 03/09/23, 21:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38718

  10. Christian Eßl uploaded patch set 7 V -1 03/10/23, 05:22

  11. core-ci voted on patch set 7 V +1 03/10/23, 05:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38726

  12. Benni Mack commented on patch set 7 03/10/23, 08:08

    AbstractDatabaseRecordProvider.php:73

    I wonder why we just don't use BackendUtility::getRecord and wrap this into a runtimeCache?
  13. Christian Eßl uploaded patch set 8 V +1 03/10/23, 11:19

  14. Christian Eßl commented on patch set 7 03/10/23, 11:21

    AbstractDatabaseRecordProvider.php:73 Reply

    Ack
  15. core-ci voted on patch set 8 V +1 03/10/23, 11:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38764

  16. Oliver Klee commented on patch set 8 03/10/23, 12:05

    FileReferenceContainer.php:546 Reply

    Done
  17. Oliver Klee commented on patch set 8 03/10/23, 15:53

    AbstractContainer.php:142

    I'd like to propose we make the new methods `@internal` so we can refactor or delete them later at will.
  18. Christian Eßl uploaded patch set 9 V +1 03/11/23, 15:44

  19. Christian Eßl commented on patch set 8 03/11/23, 15:45

    AbstractContainer.php:142 Reply

    Done
  20. core-ci voted on patch set 9 V +1 03/11/23, 15:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38798

  21. Christian Kuhn commented on patch set 9 CR -1 03/21/23, 15:03

    in general, i get the idea on what you're doing here and think we could very well improve the code to increase performance. i have one remark that may/should be refactored from my point-of-view, though. would you like to have a look?

    AbstractContainer.php:144 Unresolved

    this is the part of the patch that i don't like much: the container and element classes should essentially work on data that has been created by the provider classes, only. instead of abstracting the permission stuff into the container abstract, they should be wired into the data array somehow. i could imagine we add this to the pages related data as sub-key, or have an own key within the data array or something like that. this may also remove the need for the runtime cache entirely. do you think it's possible to refactor the patch in this regard somehow? at the moment, i don't have "the solution" at hand, but only the general direction. if you're stuck, we could have a chat on this to see if we can move this patch forward together. please ping me if so, i'd need some time to look up more details.
  22. Oliver Klee commented on patch set 9 07/16/23, 08:35

    How should we continue here?
  23. Oliver Klee wrote 08/25/24, 10:13

    Removed cc Oliver Klee.
  24. Benni Mack marked it work in progress 03/06/25, 18:53

  25. Benni Mack abandoned the change 11/12/26, 18:59

    abandoning this one (it's stale) in favor of this approach, which hits the spot that Christian (Kuhn) mentioned: https://review.typo3.org/c/Packages/TYPO3.CMS/+/97584