Review main Abandoned

68916[TASK] Don't concatenate ext_localconf / ext_tables to cache

Christian Kuhn CR 0 V 0 Hard +13 −444 updated 04/29/21, 17:48

Commit message

Every TYPO3 dev knows about this:
All ext_localconf.php and ext_tables.php files of loaded
extensions are compiled into one cache file that is
loaded instead of the single files.

Back in the dark ages, this was a performance measure
to suppress disk I/O calls for those poor souls that
didn't run some opcode cache.

Nowadays opcache is everywhere and any person capable of
thinking and breathing at the same time doesn't disable
it artifically for performance reasons.

This leads to the funny situation that those compiled
files are a burden and not of any help: They eat opcache
memory while the single files are usually opcache'd too,
and disk I/O doesn't happen anyways.

The patch throws the compilation step away: It has no
positive performance impact anymore.

This gives a series of additional positive aspects:
* devs need to delete main core cache less often
* bootstrap is simplified
* strict_types=1 and use statements are possible

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 6

Review log 711

  1. Christian Kuhn uploaded patch set 1 04/29/21, 16:03

  2. core-ci voted on patch set 1 V -1 04/29/21, 16:05 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10918

  3. Christian Kuhn uploaded patch set 2 04/29/21, 16:14

  4. core-ci voted on patch set 2 V +1 04/29/21, 16:25 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10920

  5. Christian Kuhn updated the commit message in patch set 3 04/29/21, 17:10

  6. Christian Kuhn updated the commit message in patch set 4 04/29/21, 17:11

  7. core-ci voted on patch set 4 V +1 04/29/21, 17:22 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10924

  8. core-ci voted on patch set 3 V +1 04/29/21, 17:22 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10923

  9. Benjamin Franzke commented on patch set 4 CR -2 04/29/21, 17:30

    Note that ext_* files are loaded *conditionally* (if (file_exists(…)) that means they are not only covered by opcache, but also require a stat(2) cache. Now, please read https://www.php.net/manual/en/function.clearstatcache.php > You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return false until you create the file. If you create the file, it will return true even if you then delete the file. However unlink() clears the cache automatically. Given that less and less extensions use ext_tables.php and localconf (thanks to DI), this means for many extension *no cache* will be used to consider whether the file exists or not. That means real disk IO, for *every* request. Now, so this is not a opcache vs no-opcache decision, but SSD vs HDD. And then it becomes clear: There are still *many* servers with HDDs, therefore I'm against this change.

    Unresolved

    Do you have numbers? I mean there where hosters (m*…*d) that sold this as an extra feature (not sure whether that's still the case).

    Unresolved

    Let's avoid bold statements like this.

    Unresolved

    Do you have some reference for this statement? Does opcache really cache every single file, forever? I pretty sure this is incorrect, as it would lead to major cache leaks.
  10. Christian Kuhn abandoned the change 04/29/21, 17:33

  11. Benjamin Franzke commented on patch set 4 04/29/21, 17:48

    Unresolved

    While this is a small improvement regardingr DX, ext_localconf/tables still is a mess because it relies on global state, makeInstance and stuff and still isn't fun to work with. We've made good progress of reducing ext_localconf/tables usage, so I don't think it's worth for developers to *refactor* the ext_localconf/tables file, it would be much better to be able to move stuff into Configuration/, eg. into Service.yml/php.