Coteditor: Performance with Wrap Lines Disabled is Very Poor in Some Conditions

Created on 13 Oct 2020  ·  3Comments  ·  Source: coteditor/CotEditor

Environment

  • CotEditor: 3.9.6 (435)
  • System: macOS Version 10.15.7 (Build 19H2)
  • Language: English

Short Description

Performance of large documents with long lines deteriorates when lines are not wrapped.
May be similar issue to this one:
https://github.com/coteditor/CotEditor/issues/1089

Steps to Reproduce the Issue

Create a document with extremely long lines (like embedded images in CSS or HTML for example) and set "Wrap Lines" to unwrapped or off.
Performance drops very low. The longer you work with the document the slower it gets until you can only edit tet at about one character per second.
Re-enabling line-wraps alleviates the slowness instantly. Turning off line wrapping resumes the slow performance.

Expected Result

Performance should stay quick even when lines are not wrapped into the window. (maybe especially since lines are not wrapped into the window)

better to fix

All 3 comments

Thank you for the report.
I've just confirmed the issue.

By testing several cases and observing the behavior, I found the invisible drawing takes a lot when long lines are unwrapped.
So the instant workaround would be hiding Invisibles before unwrapping such files.

As for further versions, I'll (of course) try fixing it as much as possible. However, I'm currently not sure whether I can ship it with the next version that is planned to release shortly before the macOS Big Sur release.

I've just optimized the invisible drawing calculation and this issue is quasi-fixed.
It still takes longer time than wrapped lines (long line drawing is hard, in general), but the result becomes much much better than the current version.
This change will be shipped with CotEditor 4.0.0 (and the next beta, CotEditor 4.0.0-beta.3).

Please let me know if something takes still long with these versions under some specific conditions.

I just changed my mind to release CotEditor 3.9.7 before releasing 4.0.0 for Big Sur.
So this improvement was also included in 3.9.7, which was released today.

Was this page helpful?
0 / 5 - 0 ratings