Review main Merged

26787[TASK] Speedup typolink root-line handling

Steffen Ritter CR +2 V +2 Normal +58 −22 updated 01/14/14, 17:49

Commit message

The link generation via typolink needs the domain record as well
as the rootline to generate the links correctly. To save
superfluous database queries some local caches are introduced.

Furthermore the rootline cache does not use all information which
is present after the database query. This information is unpacked
here, too. As a result less requests to the CacheFrontend need to
be done.

Review

  • Code review CR +2
    • Oliver Hader +2
    • Helmut Hummel +2
    • Jo Hasenau +1
    • Markus Klein +1
  • Verified V +2
    • Oliver Hader +2
    • Markus Klein +1

Issues 1

Files 2

Review log 25

  1. Mr. Jenkins commented on patch set 1 01/13/14, 18:23

  2. Markus Klein commented on patch set 1 01/13/14, 18:27

    RootlineUtility.php:198

    Proposal: invert the condition and the bodies. saves one ! and is more logical to read IMO.

    RootlineUtility.php:206

    Please add a comment here what this magic actually does. ;-) Can't we use a simple for loop here?
  3. Benni Mack commented on patch set 1 V +1 CR +1 01/13/14, 18:50

    Speeds up un-cached pages immensly.
  4. Oliver Klee commented on patch set 1 01/13/14, 21:54

    TypoScriptFrontendController.php:4923

    I'd prefer a field in the class instead. static local variables are impossible to mock in unit tests.
  5. Helmut Hummel commented on patch set 1 01/14/14, 06:40

    TypoScriptFrontendController.php:4923 Reply

    And this actually is a rootline cache not a domain cache
  6. Steffen Ritter commented on patch set 1 01/14/14, 08:28

    TypoScriptFrontendController.php:4923 Reply

    hmm... the function retrieves DomainData for every PID - (which indeed is generated by combining rootline and domain info) - the result is cached... so either the function name does not describe what it does or it is a domainData cache ;)
  7. Helmut Hummel commented on patch set 1 01/14/14, 12:38

    TypoScriptFrontendController.php:4923 Reply

    ah, right, sry
  8. Oliver Hader commented on patch set 1 V -1 01/14/14, 13:45

    Failure in front-end...
  9. Oliver Hader uploaded patch set 2 01/14/14, 13:55

  10. Mr. Jenkins commented on patch set 2 01/14/14, 14:11

  11. Oliver Hader uploaded patch set 3 01/14/14, 14:20

  12. Oliver Hader commented on patch set 3 V +1 CR +1 01/14/14, 14:22

    Implemented Markus' remarks
  13. Jo Hasenau commented on patch set 3 01/14/14, 14:26

    There's some more reduncdancy to get rid of - see comment.

    RootlineUtility.php:210

    Shouldn't this one check for existing cache identifiers for that particular UID first and do a break as soon as it hits one?
  14. Mr. Jenkins commented on patch set 3 01/14/14, 14:35

  15. Oliver Hader uploaded patch set 4 01/14/14, 14:47

  16. Jo Hasenau voted on patch set 4 CR +1 01/14/14, 14:49

  17. Oliver Hader voted on patch set 4 V +1 CR +1 01/14/14, 14:54

  18. Mr. Jenkins commented on patch set 4 01/14/14, 15:14

  19. Markus Klein commented on patch set 4 CR +1 01/14/14, 15:48

    RootlineUtility.php:205

    Still I'd prefer a for loop here, but ok with me. for ($depth = count($entry) - 2; $depth > 0; --$depth) { $parentCacheIdentifier = $this->getCacheIdentifier($entry[$depth]['uid']); ... }
  20. Markus Klein commented on patch set 4 01/14/14, 17:03

    TypoScriptFrontendController.php:4929

    This function is ONLY used if config.typolinkEnableLinksAcrossDomains or config.typolinkCheckRootline is set.
  21. Markus Klein voted on patch set 4 V +1 01/14/14, 17:23

  22. Helmut Hummel voted on patch set 4 CR +2 01/14/14, 17:47

  23. Oliver Hader voted on patch set 4 V +2 CR +2 01/14/14, 17:48

  24. Helmut Hummel merged patch set 5 01/14/14, 17:48

  25. Helmut Hummel commented on patch set 5 01/14/14, 17:49

    Cherry Picked This patchset was cherry picked to change: Iea7fff4c6c624a03b75523a7352b5f9736f2d57e