Review main Merged

79522[TASK] Add shared cache for VariableProcessor

Oliver Hader CR +2 V +2 Normal +90 −17 updated 07/04/23, 21:20

Commit message

VariableProcessor::addHash() is called to convert URI path
variables that don't comply with certain rules to a hash,
which does.

First of all, variables must not exceed a certain length
of 32, second of all, variables must only contain word
characters aka "\w" or "[A-Za-z0-9_]".

So whenever a variable is too long or contains invalid
characters, it is converted to an md5 hash which complies
with both rules.

It has been reported that the checks, whether to generate a
hash and the hashing would have a very noticable performance
impact.

This change introduces as specific runtime cache for
VariableProcessor that is shared with any other new instance.
This way, the necessity whether a hash is required and the hash
representation of a value can be resolved from this cache.

For instance, this would speed up scenarios that are enerating
large product lists and generate, when every invocation with a
new UID would have triggered a new hash check and assignment.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 912

  1. Oliver Hader uploaded patch set 1 06/27/23, 14:45

  2. Oliver Hader uploaded patch set 2 06/27/23, 14:51

  3. core-ci voted on patch set 1 V +1 06/27/23, 14:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43040

  4. core-ci voted on patch set 2 V +1 06/27/23, 14:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43041

  5. Benni Mack commented on patch set 2 06/28/23, 09:07

    VariableProcessorCache.php:24

    please make it internal
  6. Oliver Hader commented on patch set 3 V +1 06/30/23, 07:27

    Published edit on patch set 2.
  7. Oliver Hader commented on patch set 3 06/30/23, 07:27

    VariableProcessorCache.php:24 Reply

    Done
  8. core-ci voted on patch set 3 V +1 06/30/23, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43134

  9. Benni Mack voted on patch set 3 V +1 CR +1 07/04/23, 07:37

  10. Stefan Bürk voted on patch set 3 V +1 CR +1 07/04/23, 21:16

  11. Oliver Hader voted on patch set 3 V +2 CR +2 07/04/23, 21:18

  12. Oliver Hader merged patch set 4 07/04/23, 21:20