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

Adding a new word to Glossary is very slow #5418

Closed
ldmpub opened this issue Feb 13, 2021 · 4 comments · Fixed by #5672
Closed

Adding a new word to Glossary is very slow #5418

ldmpub opened this issue Feb 13, 2021 · 4 comments · Fixed by #5672
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@ldmpub
Copy link
Contributor

ldmpub commented Feb 13, 2021

Describe the issue

When adding a new glossary term ... pop-up stays displayed a looooonnnng time (while an icon is turning in the background near "Glossary")

I already tried

With short words => same issue

Second issue linked: several "Save" in the popup create several entries!

Steps to reproduce the behavior

Go to https://hosted.weblate.org
Context: viewed in french glossary while working on Weblate translation projetct.

Expected behavior

  1. More speed (less checks?)
  2. No duplicates creation (prevent several saves from the popup).

Priority:

  1. High
  2. Low

Good luck for debug / troubleshoot 👍

@nijel
Copy link
Member

nijel commented Feb 13, 2021

It's a limitation of current implementation - it immediately adds strings to the files and that is slow. There are no checks involved in the glossary. There is a plan to rewrite it to split adding of the strings from saving to the files (similarly like we do with changes to existing strings).

@nijel nijel added the enhancement Adding or requesting a new feature. label Feb 13, 2021
@nijel nijel added this to the 4.5.1 milestone Feb 13, 2021
@ldmpub
Copy link
Contributor Author

ldmpub commented Feb 13, 2021

@nijel => Ok thanks for your clear and quick answer,

In the meanwhile I will use this feature (add new term to glossary) with caution 🤝.

@nijel nijel modified the milestones: 4.5.1, 4.5.2 Mar 5, 2021
@nijel nijel changed the title Adding a new word to Glossary is very slow on https://hosted.weblate.org Adding a new word to Glossary is very slow Mar 5, 2021
nijel added a commit that referenced this issue Mar 10, 2021
There is no reason why it should be embedded as all callers skip
save anyway.

Issue #5418
nijel added a commit that referenced this issue Mar 11, 2021
This will be used to track additional details which do not have
to be queried.

Issue #5418
nijel added a commit that referenced this issue Mar 11, 2021
It will be used for upcoming features.

Issue #5418
nijel added a commit to nijel/weblate that referenced this issue Mar 12, 2021
Create a in-memory storage and validate the string would be added
correctly.

This also does a heavy cleanup in the file formats handling of new units
and tests - these now properly test monolingual behavior.

Issue WeblateOrg#5418
nijel added a commit that referenced this issue Mar 13, 2021
Create a in-memory storage and validate the string would be added
correctly.

This also does a heavy cleanup in the file formats handling of new units
and tests - these now properly test monolingual behavior.

Issue #5418
@nijel nijel self-assigned this Mar 16, 2021
nijel added a commit to nijel/weblate that referenced this issue Mar 17, 2021
- This makes adding units cheap - they are only added to the database.
- Units are written when commit is needed together with other pending changes.
- Simplify the interface to no longer accept batches. The performance
  gain is now minimal and it makes the code way simpler (it can directly
  return added unit instead of list that would have to be processed by
  caller).

Fixes WeblateOrg#5418
Fixes WEBLATE-64T
nijel added a commit that referenced this issue Mar 17, 2021
- This makes adding units cheap - they are only added to the database.
- Units are written when commit is needed together with other pending changes.
- Simplify the interface to no longer accept batches. The performance
  gain is now minimal and it makes the code way simpler (it can directly
  return added unit instead of list that would have to be processed by
  caller).

Fixes #5418
Fixes WEBLATE-64T
@github-actions
Copy link

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.

@ldmpub
Copy link
Contributor Author

ldmpub commented Mar 17, 2021

Thanks Michal 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants