Handling of RTFData in OS X has been problematic since it was introduced. Here’s a NUG thread from 2008
The problem is still there in Xojo 9 Cocoa. I filed bug report #25533 with a simple example, but later realized it’s well known . The problem isn’t noticeable with small amounts of text, but speed decreases exponentially as a function of text length (twofold increase in length = ~8-fold decrease in speed), so it quickly becomes unusable except for the most modest of styled text uses. This is part of the note left by Joe Strout in the above thread:
For the curious: Shark shows that it’s spending most of its time inside StyledTextParagraphCountGetter, calling StringDBCSMid3, which is the equivalent of RB’s Mid( start, str, length ). Calling Mid is a horribly inefficient way of iterating through the characters in a string, since it has to start over counting characters from the beginning every time (since a character may take more than 1 byte).
Although this problem was bad, one could easily avoid it by using TextStyleData to store/retrieve styled text, which is what I did. However, TextStyleData has been dropped from Xojo Cocoa and we now must use StyledText. So it really has to work now. Joe mentioned that he was planning on getting to TextAreas this week. I don’t know if Joe Strout’s diagnosis is correct, but if so it wouldn’t seem terribly hard to remedy (of course I don’t know for sure he’s correct). In any case, this old problem is going to cause new pain, and I strongly urge that it be revisited.