Review 13.4 Merged

87662[TASK] Cache ordered providers in FormEngine

Oli Bartsch CR +2 V +2 Hard +184 −320 updated 01/08/25, 07:55

Commit message

For large records with many "open" inline children, FormEngine
calculates the same OrderedProviderList over and over again.
This can turn into a bottleneck since DependencyOrderingService
is CPU hungry due to its graph algorithms.

The result of DependencyOrderingService within OrderedProviderList
is a function from given input arguments and can be easily
cached. The patch adds a runtime cache to OrderedProviderList, the
patch can be backported to v13 without side effects.

The patch also reveals some loose ends: It would be much better
to change FormDataGroupInterface to receive the 'providerList'
as argument to compile() which would render implementing services
stateless and shared. This would reduce the number of created
objects in this area to simplify and further improve performance.
It would be even better to turn the lists into service providers
which could be built and cached once at compile time.
This is out of scope of this patch and open for additional patches.

The change gives a measurable performance impact with records
having many "open" inline children: Editing a simple content
elmement with ten attached images reduces the number of expensive
calls to "orderByDependencies()" and saves about 5% server time at
the cost of slightly additional consumed of memmory.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 1

Files 16

Review log 34

  1. Oli Bartsch commented on patch set 1 01/08/25, 07:37

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 01/08/25, 07:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72078

  3. Oli Bartsch voted on patch set 1 CR +2 V +2 01/08/25, 07:55

  4. Oli Bartsch merged patch set 2 01/08/25, 07:55