Closed tomassabat closed 1 year ago
Rapidly hitting tab is sufficient to overload Studio: the undo/redo actions isn't necessary to cause freezing. Edited the original issue post to reflect this.
It appears as though the rate at which the indents and outdents are performed is the biggest factor.
Performing 10 indent one second apart is completely fine. The increase in memory usage is nominal (20MB or so). Doing it quickly freezes the program, allocating enormous amounts of memory (up to 6GB) in the process.
I suspect that there is some sort of backpressure issue here, where if actions aren't processed quickly enough Compose locks up.
Edit: Found a cause: TextProcessor:435 delay(Duration.milliseconds(TYPING_WINDOW_MILLIS))
. We launch a coroutine that delays and then tries to repeatedly decrementandget changeCount
, an atomic integer. Some sort of locking problem. I don't think it's sufficient to remove the delay, however there is a huge increase in responsiveness once we do so.
This is no longer reproducible on the development branch after other work has been done upgrading compose and making changes to how the text editor functions under the hood. Closing.
Description
Studio freezes and has to be restarted when undoing/redoing changes that affect large chunks of text.
Environment
Reproducible Steps
Steps to create the smallest reproducible scenario: