Review main Merged

93785[BUGFIX] Avoid redundant scans during language pack updates

Benni Mack CR +2 V +2 Easy +11 −9 updated 06/05/26, 11:52

Commit message

Updating language packs is slow since the v14 localization
related changes.

LanguagePackService::getExtensionLanguagePackDetails() iterates
over all active packages and probes the filesystem for *.xlf files.
The existence check uses Finder::count(), which is short-circuited
to hasResults() to exit on first match.

The bigger win is reducing how often this method runs.
languagePackDownload() calls getExtensionLanguagePackDetails() on
every invocation to guard against arbitrary key/iso input from the
install tool's languagePacksUpdatePackAction(). The 'language:update'
CLI command calls languagePackDownload() once per extension and per
active language, so each invocation re-runs the full scan. On an
instance with N extensions and L active languages this meant N*L+1
scans per language:update run.

The patch moves the guard where untrusted input actually lives:
The install tool's languagePacksUpdatePackAction() now calls
getExtensionLanguagePackDetails() once and gates the key/iso
pair before delegating to the service.

Measured on an install with 34 extensions and 23 active languages,
the patch saves about 7.0 seconds per language:update run before
network transfer.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1923

  1. Benni Mack uploaded patch set 1 04/21/26, 15:07

  2. Christian Kuhn voted on patch set 1 CR +1 V +1 04/21/26, 15:42

  3. core-ci voted on patch set 1 V +1 04/21/26, 15:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100660

  4. Garvin Hicking voted on patch set 1 CR +1 V +1 04/21/26, 20:06

  5. Garvin Hicking commented on patch set 1 04/21/26, 20:09

    We should also inspect what @stephan.grossberndt@typo3.org wrote in the issue though, there's more to it apart from this fox?
  6. Benni Mack updated the commit message in patch set 2 CR +1 V +1 04/22/26, 07:21

  7. Benni Mack rebased onto patch set 3 05/04/26, 19:12

  8. core-ci voted on patch set 3 V +1 05/04/26, 19:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101493

  9. Christian Kuhn commented on patch set 3 05/04/26, 21:08

    Reply

    Stephan is correct. There is more potential, and the hasResult() finder is not the biggest bummer. I'll update.
  10. Christian Kuhn uploaded patch set 4 V +1 05/04/26, 21:14

  11. Christian Kuhn updated the commit message in patch set 5 05/04/26, 21:15

  12. core-ci voted on patch set 5 V +1 05/04/26, 21:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101498

  13. Christian Kuhn voted on patch set 5 CR +1 V +1 05/04/26, 21:34

  14. Garvin Hicking voted on patch set 5 CR +1 05/04/26, 21:41

  15. core-ci voted on patch set 4 V +1 05/04/26, 21:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101497

  16. Georg Ringer voted on patch set 5 CR +1 V +1 05/05/26, 02:49

  17. Oliver Klee voted on patch set 5 CR +1 05/05/26, 07:19

  18. Christian Kuhn commented on patch set 5 V 0 CR -1 05/05/26, 08:08

    need to verify a-new.
  19. Christian Kuhn voted on patch set 5 CR 0 05/05/26, 16:12

  20. Garvin Hicking commented on patch set 5 V +1 06/05/26, 08:17

    This works for me, and I debugged why the process is still slow on my machine. Turns out that curl_exec (network traffic) takes up 97,4% of the execution (as I have 123 requests that are made).
  21. Christian Kuhn commented on patch set 5 CR +1 V +1 06/05/26, 11:05

    Reply

    Done
  22. Christian Kuhn voted on patch set 5 CR +2 V +2 06/05/26, 11:41

  23. Christian Kuhn merged patch set 6 06/05/26, 11:52