#105054Flexform migrations executed during schema generation is expensive
Description
Scenario:
- EXT:bootstrap_package is installed
- A page contains 140 “Accordion” content element, each contains an empty item (=280 records)
Symptoms
If said page is opened in the “Page” module, loading the module is slow and needs roughly 4 seconds on a MacBook Pro M3, while running TYPO3 in ddev. The situation gets worse when the “Debug” preset is enabled, the loading time expands to 20-30 seconds.
Technical explanation
BackendLayoutRenderer makes use of RecordFactory, which in turn resolves the records and their relations. While creating Record objects, RecordFieldTransformer may hit on flexform fields (pi_flexform). This will invoke FlexFormSchemaFactory->createSchemataForFlexField(). This code path is expensive, as it will run online FlexForm migrations for the full TCA per content element.
If logging to the deprecation log is enabled (which is given by enabling the “Debug” preset), things get worse as each repetitive migration may trigger the same deprecations over and over again, resulting in writing 16 GB of data into the deprecation log per request.
Reviews 3
Related issues 1
History 39
-
Andreas Kienast changed description <span data-processor="relativetime" data-value="2024-09-20T06:06:57+00:00" > 09/20/24, 06:06 </span>
-
Andreas Kienast commented <span data-processor="relativetime" data-value="2024-09-20T06:17:05+00:00" > 09/20/24, 06:17 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 86245 status
NewUnder Review <span data-processor="relativetime" data-value="2024-09-20T13:25:16+00:00" > 09/20/24, 13:25 </span> -
Benjamin Franzke changed Related to #105075 <span data-processor="relativetime" data-value="2024-09-21T16:17:04+00:00" > 09/21/24, 16:17 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 86432 <span data-processor="relativetime" data-value="2024-10-05T13:17:39+00:00" > 10/05/24, 13:17 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 86432 <span data-processor="relativetime" data-value="2024-10-05T13:36:40+00:00" > 10/05/24, 13:36 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 86432 <span data-processor="relativetime" data-value="2024-10-05T19:19:16+00:00" > 10/05/24, 19:19 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 86432 <span data-processor="relativetime" data-value="2024-10-06T04:43:23+00:00" > 10/06/24, 04:43 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 86432 <span data-processor="relativetime" data-value="2024-11-18T13:58:15+00:00" > 11/18/24, 13:58 </span>
There’s already a POC patch that introduces a cache for the flex schema generation: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86197