I’m just wondering if what I’m doing is correct or not, reason being that I’m finding this procedure to be pretty slow in performance compared to everything else I’m doing in iced
.
I’m populating a text_editor::Content
with up to 4096 lines of text, where each line is a string representation of an f32
. Running in --release
on my mediocre desktop computer, the call to Content::with_text
takes about 70ms, which is “glacial” (see how I related that to ice?) compared to everything else going on around it. I see that the method is only taking an &str
, but the implementation of the TextEditor
disappears into the depths of cosmic_text
or some such and is a bit beyond me.
Playing around with it a bit, it was about 10ms faster to SelectAll
and Paste
to overwrite the contents of a pre-populated Content
, but, as I say, pretty much everything else is measured in µs.
Is this just something that I need to work around? What’s it doing that takes so long?