Review 13.4 Merged

93433[TASK] Speed up PolymorphicDeserializer::parseClassNames()

Oliver Hader CR +2 V +2 Easy +25 −24 updated 03/30/26, 19:00

Commit message

The previous implementation called isInsideString() once per
class-name token found in the payload. Each call ran a full
preg_match_all() scan of the payload to locate string ranges,
making parseClassNames() O(n*m) in the number of tokens times
the payload length.

String ranges are now computed once upfront before the token
loop and reused for every offset check, reducing complexity to
O(n+m). Duplicate class names are also skipped early via an
in_array() guard so repeated occurrences of the same class
(e.g. Package appearing once per extension) do not trigger
redundant is_a()/is_subclass_of() calls in deserialize().

The now-unused isInsideString() helper has been removed.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Oliver Hader uploaded patch set 1 03/30/26, 15:17

  2. core-ci voted on patch set 1 V +1 03/30/26, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99085

  3. Oliver Hader voted on patch set 1 CR +2 V +2 03/30/26, 18:59

  4. Oliver Hader merged patch set 2 03/30/26, 19:00