# \[Bug\] Serious degrade of text updating in CodeEditorComponent/AsyncUpdater JUCE8

**URL:** <https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126>\
**Category:** General JUCE discussion\
**Created:** [November 7, 2024, 10:10pm UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126 "2024-11-07T22:10:46Z")\
**Posts on this page:** 6\
**Page:** 3

<div class="post-metadata">

**Author:** ![thecargocult](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thecargocult/32/10988_2.png) [@thecargocult](https://forum.juce.com/u/thecargocult)\
**Post date:** [January 29, 2025, 11:44pm UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/41 "2025-01-29T23:44:42Z")

</div>

@anthony-nicholls I have some more test results re: resizing performance. DO you want it here or a new thread? I feel like I’m derailing this one.

---

<div class="post-metadata">

**Author:** ![thecargocult](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thecargocult/32/10988_2.png) [@thecargocult](https://forum.juce.com/u/thecargocult)\
**Post date:** [January 30, 2025, 12:02am UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/42 "2025-01-30T00:02:14Z")

</div>

new thread here:

> [@Juce 8 Performance of getStringWidth](https://forum.juce.com/t/juce-8-performance-of-getstringwidth/65040):
>
> Font::getStringWidth() is deprecated and the suggested replacement is GlyphArrangement::getStringWidthInt(). I ran a simple test on 100000 calls to these methods in juce 6 and juce 8, for a string with 51 characters. Juce 6 Font::getStringWidth() = 2.1sec Juce 8 Font::getStringWidth() = 11.8sec Juce 8 GlyphArrangement::getStringWidthInt = 81.0sec Not super scientific but the difference is massive, and in a real world scenario the performance drop is definitely noticeable. I’m aware that t…

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [February 5, 2025, 4:59am UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/43 "2025-02-05T04:59:06Z")

</div>

Bumping as I’ve also noticed some pretty rough stutters with TextEditor as of JUCE 8.

I tried to follow along everything going on above so hopefully I didn’t miss this being addressed.

I’m doing a function like such

```cpp

    //In an overriden version of TextEditor
    void insertTextAtCaret(const String& text, const Font& textFont, const Colour& textColour)
    {       
        setFont(textFont);
        setColour(TextEditor::textColourId, textColour);
        TextEditor::insertTextAtCaret(text);
    };

And then in another function like such.

    text.insertTextAtCaret("Lead Programmer / Creator", lf, tc);
    text.insertTextAtCaret("\n\n -Text\n\n\n", sf, tc);

    text.insertTextAtCaret("Interface Graphic Design", lf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text\n\n\n", sf, tc);

    text.insertTextAtCaret("Beta Testers (Much Love!)", lf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);
    text.insertTextAtCaret("\n\n -Text", sf, tc);

```

I don’t have benchmark times from juce 7, but since upgrading to 8.0.6 this function takes almost 5 seconds which is WAY more than previously. It seems each insert text causes the next call to be even longer. I don’t know if thats just due to text size or caching or something.

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [February 5, 2025, 8:29am UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/44 "2025-02-05T08:29:24Z")

</div>

This is a known issue. The current TextEditor’s implementation details aren’t a good fit for the new, more powerful text shaping building blocks. A new implementation is being worked on which addresses the performance regression.

---

<div class="post-metadata">

**Author:** ![Wiznat](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/wiznat/32/11103_2.png) [@Wiznat](https://forum.juce.com/u/Wiznat)\
**Post date:** [March 19, 2025, 6:38pm UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/45 "2025-03-19T18:38:04Z")

</div>

Just wondering if there’s been any update on this or an estimated date we might see a fix? I see there was a commit with some text editor changes yesterday but seems like just a bug fix

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [March 20, 2025, 8:59pm UTC](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126/46 "2025-03-20T20:59:38Z")

</div>

Over the last week we released significant improvements to the TextEditor both in terms of performance and behaviour with regards to working with ligatures and bidi text.

With today’s bugfix on develop, I can recommend that you give it a try

> <https://github.com/juce-framework/JUCE/commit/5f5a247f82133ab28b57038ca807de011cc6feb3>

[Previous page](https://forum.juce.com/t/bug-serious-degrade-of-text-updating-in-codeeditorcomponent-asyncupdater-juce8/64126.md?page=2)
