Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practise project/component size #5152

Closed
eschumacher-99 opened this issue Jan 6, 2021 · 11 comments · Fixed by #5153
Closed

Best practise project/component size #5152

eschumacher-99 opened this issue Jan 6, 2021 · 11 comments · Fixed by #5153
Assignees
Labels
bug Something is broken.
Milestone

Comments

@eschumacher-99
Copy link

Hello,
I would like to know what's the best size for projects and components on Weblate.
Currently, I have one project with 4 components that each hold 20.000 strings and 27 languages.
Everytime I click on a component, it takes about half an hour for it to parse the xliff file and show up on my screen.
This happens since around version 4.2 or 4.3 I believe.
Is there any way to avoid this or is it better to split it into more and therefore smaller components?
Would that change anything?

@eschumacher-99 eschumacher-99 added the question This is more a question for the support than an issue. label Jan 6, 2021
@github-actions
Copy link

github-actions bot commented Jan 6, 2021

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you!

@nijel
Copy link
Member

nijel commented Jan 6, 2021

Everytime I click on a component, it takes about half an hour for it to parse the xliff file and show up on my screen.

There is no file parsing going on when displaying the page, it has to be something else causing this delay.

What can be lengthy is updating stats, but this is cached and should not happen that often.

What version do you currently use?

@eschumacher-99
Copy link
Author

What version do you currently use?
I'm using Version 4.3

@nijel
Copy link
Member

nijel commented Jan 6, 2021

I think there were some slight changes in 4.4, but I don't think it will make a major difference.

When starting with an empty cache, calculating the stats take 4-8 database queries per translation. This should be needed only for changed translations, and it is pre-calculated in the background. If massive changes are going on in all the translations, it will definitely have measurable impact.

In case it happens to you regularly, it would be interesting to figure out why it happens.

@nijel
Copy link
Member

nijel commented Jan 6, 2021

@eschumacher-99 I did answer it there, and I don't see how it is related to this issue...

@eschumacher-99
Copy link
Author

I looked it up and this is the part that causes the problem. base contains the whole xliff file and this method gets called everytime you click on the project.

diff --git a/formats/ttkit.py b/formats/ttkit.py
index 19b0f86..fb09758 100644
--- a/formats/ttkit.py
+++ b/formats/ttkit.py
@@ -369,7 +369,7 @@ class TTKitFormat(TranslationFormat):
         if not base:
             return monolingual and cls.new_translation is not None
         try:
-            cls.parse_store(base)
+            #cls.parse_store(base)
             return True
         except Exception:
             report_error(cause="File parse error")

@nijel
Copy link
Member

nijel commented Jan 6, 2021

It really shouldn't, can you please try whether upgrading addresses it?

@nijel
Copy link
Member

nijel commented Jan 6, 2021

Hmm, looking at the code it can indeed happen in some situations...

@nijel nijel added bug Something is broken. and removed question This is more a question for the support than an issue. labels Jan 6, 2021
@nijel nijel self-assigned this Jan 6, 2021
@nijel nijel added this to the 4.4.1 milestone Jan 6, 2021
nijel added a commit to nijel/weblate that referenced this issue Jan 6, 2021
This is expensive operation and should be done only when needed and not
when just browsing pages to figure out whether user can add language or
not.

Fixes WeblateOrg#5152
@nijel
Copy link
Member

nijel commented Jan 6, 2021

#5153 should address the issue I've found (it's not yet tested, waiting for CI to run the tests)

nijel added a commit that referenced this issue Jan 6, 2021
This is expensive operation and should be done only when needed and not
when just browsing pages to figure out whether user can add language or
not.

Fixes #5152
@github-actions
Copy link

github-actions bot commented Jan 6, 2021

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@eschumacher-99
Copy link
Author

#5153 should address the issue I've found (it's not yet tested, waiting for CI to run the tests)

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants