Review main Merged

79514[BUGFIX] Avoid symfony/property-access in getGettablePropertyNames()

Alexander Schnitzler CR +2 V +2 Normal +54 −19 updated 07/04/23, 09:49

Commit message

ObjectAccess::getGettablePropertyNames() has quite the history by now.
It used to be quite simple, an is_callable() check for getters/hassers
and issers of objects. That didn't account for methods with mandatory
method arguments which was fixed by using reflection. Because runtime
reflection is slow, the usage of cached reflection (ClassSchema) had
been introduced. But, during that change, symfony/property-access had
also been introduces, which contradicts the idea of performance gain
because:

- symfony/property-access also uses uncached reflection
- symfony/property-access actually calls the accessors under test

As both is undesirable, the usage of symfony/property-access has been
removed again.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Markus Klein +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1011

  1. Alexander Schnitzler uploaded patch set 1 06/27/23, 07:21

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

  3. Alexander Schnitzler marked it ready for review 06/27/23, 07:38

  4. Alexander Schnitzler wrote 06/27/23, 07:38

    Topic set to extbase
  5. Benni Mack commented on patch set 1 06/27/23, 08:39

    should we also change this in getSettablePropertyNames ?
  6. Alexander Schnitzler commented on patch set 1 06/27/23, 10:00

    Reply

    I'm not too sure about the performance impact there (yet). But yes, IMHO we should avoid symfony/property-access altogether because we cannot share our reflection caches with them. But I'd like to keep commits simple and short and do one after the other so we can better decide what to backport as bugfix and what not.
  7. Markus Klein commented on patch set 1 CR +1 06/28/23, 11:46

    I'm testing this also on older v10 now
  8. Markus Klein commented on patch set 1 V +1 06/28/23, 12:10

    In my testcase the speed-improvement was slightly noticeable. And nothing seems to be broken.
  9. Oliver Klee voted on patch set 1 V +1 CR +1 06/28/23, 20:29

  10. Benni Mack voted on patch set 1 V +2 CR +2 07/04/23, 09:49

  11. Benni Mack merged patch set 2 07/04/23, 09:49