Zanata UI gets really sluggish on long translated strings
Description
Environment
Activity
Former user 20 April 2018 at 00:24
We are closing all the old issues to have more clarity in our backlog for Zanata project. Feel free to re-open or leave a comment if you require our attention on your Jira.
Former user 2 February 2018 at 04:34
Issue solved in the new editor which we are working on the feature.
Former user 16 December 2015 at 00:00
@Jerome Fenal Is it slow in the new alpha editor as well? I am working on this part of the new editor at the moment so I have an opportunity to at least take a look at which code may be causing the slowness if it is in the new editor.
There are at least 3 different things we should look into relating to this:
Optimize scripts
Any code that operates on the characters of a text flow is likely worth optimizing more than general code. Because of Zanata's purpose, it is likely always to have code that operates on the translations as they are entered, and the physical laws of the universe mean that longer strings require more processing than shorter strings, but there is no harm in making them run as efficiently as possible.
Note: profiling is extremely important here - we need to know what code is taking the longest to run, and figure out whether it is memory or processing that is the bottleneck.
Run scripts asynchronously
No matter how long scripts take to run on a translation string, we should not let it slow down user-interaction. Anything that operates on the characters of a string should at least be run in a callback, and some mechanism should be used to ensure that the same callback is not running several copies at once. We have some code like this now, but it is worth a review and worth considering any time we are working with code that manipulates source and translation text directly.
Segmentation
Even without editor performance concerns, very long strings have practical problems for incremental translation and translation reuse, so we should be segmenting text so that a string is at most a single paragraph. This is something we have on the backlog, but I wanted to note here that it is likely to be the most effective speed-up for long strings, particularly ridiculously long strings such as entire support articles or books that have been uploaded as one string.
In addition to automatic segmentation that can be configured by maintainers, translators should be able to segment a string further in the editor to make it easier to work with - we will need to consider the UX implications of whether that would automatically segment the string for that language in everyone's editor, or just the translator who requests it.
Carlos Munoz 15 December 2015 at 23:26
Hi @Jerome Fenal, would this be an example of such a long string?
https://fedora.zanata.org/webtrans/Application.seam?project=freeipa&iteration=master&localeId=es&locale=en#view:doc;doc:install/po/ipa;textflow:1348032;translated:show;approved:show
When you say sluggish, what are the exact symptoms you see? (e.g. slow cursor movement, lag between keypress and character showing up, etc)
Details
Details
Assignee
Reporter
Labels
Components
Affects versions
Priority

While translating long strings in the FreeIPA project on fedora.zanata.org, it occurred that long translated strings seem to provoke Javascript slowdowns.
The longer the translated string is, the sluggisher the UI gets. Maybe worth to avoid scripts which do not scale with the string length, or throttle them a bit.