typedb / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
191 stars 44 forks source link

Investigate performance of `AnnotatedString` in a `LazyColumn` #546

Closed alexjpwalker closed 1 year ago

alexjpwalker commented 2 years ago

Problem to Solve

We've observed significant slowdown of the Text Editor when it contains a lot of long lines of TypeQL, and the most likely suspect is a bad interaction between AnnotatedString and LazyColumn.

Proposed Solution

We should investigate with a minimal example and see if it's an issue in Compose or in Studio.

jamesreprise commented 2 years ago

Scrolling on a large file with the same line repeated thousands of times is perfectly smooth, even if the line has a variety of syntax highlighting.

Even a 38 line file with many different lines can cause significant lag while scrolling.

alexjpwalker commented 2 years ago

Ok, so the issue is still occurring.

What I think we should do, for clarity, is retest this with an example that doesn't use TextEditor. Just a basic LazyColumn that renders a number of AnnotatedStrings. Then, if we can reproduce the slowness, we have a minimal reproducible sample that the compose-jb team can take a look at, without risk of them saying "you reported X, but that's because your code does Y which is unrelated"

jamesreprise commented 1 year ago

After re-creating the issue, I've identified that this no longer occurs - having bumped Compose, our text editor performance is much improved.