Review main Merged

76106[TASK] More efficient FE TypoScript cache layer

Christian Kuhn CR +2 V +2 Hard +576 −279 updated 10/21/22, 10:33

Commit message

The patch changes TSFE getFromCache() to leverage more
effective TypoScript cache layers, possible with the
new TypoScript parser.

The forge issue comes with a test bed with some
measurements. The main takeaways are:

* First page call on empty caches is slower. This is because
  the new TypoScript parser creates many more objects, creates
  various additional cache entries and can parse more details.
  We may be able to mitigate this with a warmup CLI that can be
  called after deployment later. With further development, we may
  also be able to remove the b/w compat related "array representation"
  of the TypoScript AST, avoiding a time consuming operation.
  The latter however will only materialize in v13, earliest.

* Full-page cache access is slightly slower. This is mainly due
  to a sys_template query which we *may* be able to combine with
  another query in further v12 development, and makeInstance() is
  being used a bit more often, giving DI more hard work. The difference
  to v11 isn't *that* huge, and unrelated v12 related changes influence
  this as well.

* When a first page has been called, and a second page is called
  afterwards that shares the same or at least "similar" TypoScript,
  this is *significantly* quicker since TypoScript caches are now
  re-used in between different pages, which has never been the case
  before. This is a huge win and works in-between different sites as
  well, when different sites use "similar" TypoScript includes: They
  still warmup each other.

* Calling _INT content objects on pages are *significantly* and
  *systematically* quicker. This is because full TypoScript can
  be cached and shared between pages now, and other layers kick in
  if that wasn't successful. This means repeated calls to pages with
  inexpensive _INT objects now show similar speed to full-cached
  pages, while this has been a factor of at least five before.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 2

Files 21

Show 1 more file

Review log 3446

Show 1221 earlier messages
  1. Christian Kuhn uploaded patch set 1 10/13/22, 07:59

  2. Christian Kuhn commented on patch set 1 CR -1 10/13/22, 08:03

    better constants caching done already, setup needs similar work.
  3. core-ci voted on patch set 1 V -1 10/13/22, 08:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32275

  4. Christian Kuhn uploaded patch set 2 10/14/22, 21:51

  5. Christian Kuhn commented on patch set 2 CR -1 10/14/22, 22:01

    better setup layer, but one level and no-cache cleanup still missing.
  6. core-ci voted on patch set 2 V -1 10/14/22, 22:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32348

  7. Christian Kuhn uploaded patch set 3 10/19/22, 18:48

  8. core-ci voted on patch set 3 V -1 10/19/22, 18:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32474

  9. Christian Kuhn uploaded patch set 4 10/19/22, 20:44

  10. core-ci voted on patch set 4 V -1 10/19/22, 20:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32475

  11. Christian Kuhn uploaded patch set 5 10/20/22, 07:12

  12. Christian Kuhn uploaded patch set 6 10/20/22, 07:16

  13. core-ci voted on patch set 5 V +1 10/20/22, 07:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32488

  14. core-ci voted on patch set 6 V +1 10/20/22, 07:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32489

  15. Christian Kuhn uploaded patch set 7 10/20/22, 07:39

  16. core-ci voted on patch set 7 V +1 10/20/22, 07:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32492

  17. Christian Kuhn uploaded patch set 8 10/20/22, 10:47

  18. core-ci voted on patch set 8 V +1 10/20/22, 10:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32503

  19. Christian Kuhn uploaded patch set 9 10/20/22, 11:33

  20. core-ci voted on patch set 9 V +1 10/20/22, 11:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32504

  21. Christian Kuhn updated the commit message in patch set 10 10/20/22, 12:16

  1. Christian Kuhn uploaded patch set 11 10/20/22, 12:21

  2. Christian Kuhn updated the commit message in patch set 12 10/20/22, 12:27

  3. Christian Kuhn updated the commit message in patch set 13 10/20/22, 12:27

  4. Benni Mack commented on patch set 13 10/20/22, 12:34

    TypoScriptFrontendController.php:1265

    to be honest --- all of this code has to go in easily-accessible API classes. This is all up for a followup-job of course.
  5. core-ci voted on patch set 13 V +1 10/20/22, 12:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32510

  6. Wouter Wolters commented on patch set 13 10/20/22, 12:48

    Nice work as always Christian 😊
    successful :)
  7. Christian Kuhn updated the commit message in patch set 14 10/20/22, 12:56

  8. Christian Kuhn commented on patch set 14 10/20/22, 12:57

    Reply

    Done

    TypoScriptFrontendController.php:1265 Reply

    yeah. noted that as todo on the method already. we'll have to get rid of some tsfe-state to do this, though ... i'll mitigate this with further changes a bit, already.
  9. core-ci voted on patch set 14 V +1 10/20/22, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32512

  10. Andreas Kienast commented on patch set 14 10/20/22, 13:09

    TypoScriptFrontendController.php:1232

    Unused variable, gets overridden in line 1248

    TypoScriptFrontendController.php:1352

    Unused variable, overridden in line 1378
  11. Christian Kuhn commented on patch set 14 10/20/22, 13:14

    TypoScriptFrontendController.php:1232 Reply

    true. this is preliminary to solve a todo where we'll assign these ast's to request object. hope it's fine to keep it for this version to keep systematics intact for now.

    TypoScriptFrontendController.php:1352 Reply

    true. this is preliminary to solve a todo where we'll assign these ast's to request object. hope it's fine to keep it for this version to keep systematics intact for now.
  12. Andreas Kienast commented on patch set 14 V -1 10/20/22, 13:14

    Something is fishy: Given: bootstrap_package installed and caches are flushed. When calling any subpage on level 2 (e.g. /pages/default), the text of the main menu is not readable. With a current "blank" main branch, this issue is gone.
  13. Stefan Bürk commented on patch set 14 10/20/22, 13:18

    TypoScriptFrontendController.php:1232 Reply

    no, that's not correct. L1248 is if (with L1237) no_cache === true OR !$gitConstantsFromCache this is here the part to get it from cache if !$noCache. So this is var is needed, as if this line is run, L1234 is run and L1248 not.

    TypoScriptFrontendController.php:1352 Reply

    no, that's not correct. L1378 is only executed if (with L1357) no_cache === true OR !$gitConstantsFromCache this is here the part to get it from cache if !$noCache. So this is var is needed, as if this line is run, L1354 is run and 1378 not.
  14. Stefan Bürk commented on patch set 14 10/20/22, 13:21

    TypoScriptFrontendController.php:1232 Reply

    PHPStorm is here wrong - or ?

    TypoScriptFrontendController.php:1352 Reply

    PHPStorm is here wrong - or ?
  15. Andreas Kienast commented on patch set 14 10/21/22, 06:59

    TypoScriptFrontendController.php:1232 Reply

    $constantAst is redefined within the if() block and only used there.

    TypoScriptFrontendController.php:1352 Reply

    $constantAst is redefined within the if() block and only used there.
  16. Christian Kuhn uploaded patch set 15 10/21/22, 07:46

  17. Christian Kuhn commented on patch set 15 10/21/22, 07:48

    Reply

    used wrong traverser for constants which basically made constant-condition-bodys being evaluated every time. fixed now and improved code comments along the way.

    TypoScriptFrontendController.php:1232 Reply

    phpstorm is correct: $constantAst is *not* used, but it will be used with next patch, which is why i'd like to keep it for now.

    TypoScriptFrontendController.php:1352 Reply

    phpstorm is correct here: $setupAst is not used, but it will be used with next patch, which is why i'd like to keep it for now.
  18. core-ci voted on patch set 15 V +1 10/21/22, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32562

  19. Andreas Kienast commented on patch set 15 V +1 CR +1 10/21/22, 08:10

    TypoScriptFrontendController.php:1223

    I love your comments 😂
  20. Christian Kuhn commented on patch set 15 10/21/22, 08:11

    TypoScriptFrontendController.php:1223 Reply

    Done
  21. Stefan Bürk voted on patch set 15 CR +1 10/21/22, 08:11

  22. Stefan Bürk voted on patch set 15 V +1 10/21/22, 08:32

  23. Anja Leichsenring voted on patch set 15 V +1 CR +1 10/21/22, 08:58

  24. Christian Kuhn voted on patch set 15 V +2 CR +2 10/21/22, 10:32

  25. Christian Kuhn merged patch set 16 10/21/22, 10:33