slint icon indicating copy to clipboard operation
slint copied to clipboard

TextEdit is far too slow

Open thawkins opened this issue 2 months ago • 5 comments

Bug Description

The TextEdit Control is very very slow, We were forced to create our own CustomTextEdit control able to handle 1M lines of text. the current TextEdit becomes unuseable at more that 5K lines of text, at 50K it takes over a minute on an i7-10gen machine to insert the text, causing the UI thread to frequently time out.

Reproducible Code (if applicable)


Environment Details

  • Slint Version: latest
  • Platform/OS: X86_64, Fedora 43
  • Programming Language: Rust
  • Backend/Renderer: default

Product Impact

the standard version would have been unusable, we had to spend an additional 4 weeks working on a replacement. we used the ropey crate as the buffer management.

thawkins avatar Nov 17 '25 06:11 thawkins

Sorry about that :(. It's true that we do way too much work for large text input fields right now. We're not using parley to the fullest extent here. We already split into multiple layouts, but we don't retain them.

tronical avatar Nov 17 '25 07:11 tronical

Parley 0.6 also has a performance bug around large paragraphs of text (layout perf is non-linear with regard to input text length). A fix has landed on main and will be part of the 0.7 release. That's not going to help with a 1M lines of text (you need non-contiguous text storage + lazy layout/rendering), but it should help significantly in the 5k and even 50k range.

nicoburns avatar Nov 23 '25 00:11 nicoburns

Thanks Nico! Do you have a rough idea when you'd like to release 0.7?

tronical avatar Nov 23 '25 11:11 tronical

I'm hoping this coming week. I've put up a release PR (https://github.com/linebender/parley/pull/470) but it will need to be reviewed.

nicoburns avatar Nov 23 '25 14:11 nicoburns

Release is published :)

nicoburns avatar Nov 24 '25 12:11 nicoburns

Now that parley 0.7 is used, is this still an issue?

expenses avatar Dec 12 '25 12:12 expenses