Performance issue on Mac when go to previous/next segment
Brought to you by:
laseray
I recently changed my working environment from Windows to MacOS X and experienced performance issue when tried to move between segments using keyboard. Depending on document size, it even took 2-3 seconds just to go to previous/next segment.
While I was tracing down the issue, I found it was caused by bad performance of JTextPane (used in TranslationView) on Mac version of Java. If translated text is big enough, it takes long time on Mac to reset the text on TranslationView.
Thus the issue might be solved by
Okay, this is accepted.
The actual bug fix will differ somewhat depending on how new functionality is implemented. At a minimum the refresh of the text data will be disabled when the view is closed (minimized?). As for reducing the size of text displayed, this is uncertain currently (e.g., depends on what the majority of users want).
Having looked at this bug the actual problem is not so much the code in TranslationView (a very simple brute force implementation no doubt) , but the fact that the update was being called before activating a segment. This resulted in it slowing down activation. Now, going forward, the refresh of TranslationView is done after activation. This should solve the issue to a greater degree.
Disable of refresh when the view is closed/disabled will also be implemented on top of this change.