web-vision / wv_deepltranslate

TYPO3 Extension to translate content and TCA records with DeepL Translate
GNU General Public License v2.0
25 stars 41 forks source link

[BUG] Performance problem with latest version in large site #334

Closed sypets closed 5 months ago

sypets commented 5 months ago

Describe the bug Using the latest version 4.3.1 (also reproducible with 4.2.1 and latest main), I noticed that the translation with DeepL takes very long, something between 25 seconds up to about 1 minute. This is not really usable.

To find the problem I debugged / profiled and found out that the part that is taking so long is fetching the entire page tree for the site (!) in

GlossaryRepository::getGlossariesInRootByCurrentPage:

$allPages = GeneralUtility::makeInstance(PageTreeRepository::class)
            ->getTreeList($rootPage, 999);

So, not the DeepL translation is taking so long. This is actually quite fast. Fetching all pages in a site for the glossary is causing the performance problems.

I am currently not using the glossary. The glossary is empty (no records).

To Reproduce

Steps to reproduce the behavior:

  1. Use a site with many pages
  2. translate content with "DeepL" button (not auto)

Expected behavior

I would expect:

Screenshots

image

TYPO3 Setup

Additional context

We were one of the sponsors for the glossary. (Carl von Ossietzky Universität Oldenburg). I have been using an older (patched) version of this extension. I would now like to update to latest version. I really like this extension and would like to use the new features. Not really happy with the disruption of a quite stable extension by adding (not production ready) glossary feature, though.

sypets commented 5 months ago

Thank you @NarkNiro Problem no longer reproducible with latest main.