(I'm not familiar with graphical / texture code)
But I am familiar with fast text processing. From Java the problem is even worse: it's not so much that the methods are inefficiently written in themsevles. The issue is that string processing tends to create lots of garbage which then needs to be garbage collected.
The optimization when all these strings processing methods are the bottleneck? Do not create hundreds of thousands or millions of object. Instead of doing, say, "s2 = removeLeadingAndTrailingStuff();" and then "parse(s2);" you do write your own method directly: "parseButDoNotTakeIntoAccountLeadingAndTrailingStuff()".
It's oversimplified and crazy camel case is used above to make a point ; )
It's always the same : when objects creation become the bottleneck, make it so you're not creating that many objects.
It's exactly what the LMAX Disruptor "pattern" is about: using gigantic arrays of primitives and hardly any object creation at all (to process 12 million events per second in Java on a single core!).
That said in TFA I still don't understand why several megabytes of Unicode text files have to be processed...