Help: Why does assigning StyledText to a TextArea so slow?

OK so I think the blog post @Markus_Winter was talking about was this one by Joe Ranieri.

Unfortunately placing the assignment between the BeginEditing and EndEditing extensions doesn’t speed things up at all:

Var st As New StyledText
st.Text = TextArea1.Value
st.TextColor(0, st.Text.Length) = Color.Red // This manipulation is fast.
Dim docView As Integer = TextArea1.DocumentView
Dim storage As Integer = TextArea1.TextStorage(docView)
TextArea1.BeginEditing(storage)
TextArea1.StyledText = st
TextArea1.EndEditing(storage)

This is so frustrating. I found an old post by @Christian_Schmitz so I tried using his MBS plugin but it won’t compile because it doesn’t look like you can directly assign StyledText objects…

Var st As New StyledText
st.Text = TextArea1.Value
st.TextColor(0, st.Text.Length) = Color.Red // This manipulation is fast.

If TargetMacOS Then
  TextArea1.NSTextViewMBS.textStorage.setAttributedString(st) // Error.
#EndIf

Can anyone help? It seems crazy that I can parse 30K characters with my Markdown parser in 100 ms but can’t colour a block of text in under a minute.