I found a partial solution. If you disable the anti-aliased font, performance will improve significantly. You must first have a subclass of NSTextView. Then,
- (void)drawRect:(NSRect)dirtyRect
{
[[NSGraphicsContext currentContext] setShouldAntialias:YES];
CGContextSetShouldAntialias((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], YES);
CGContextSetShouldSmoothFonts((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], NO);
[super drawRect:dirtyRect];
}
Alternatively, you can use:
self.textview.layoutManager.allowsNonContiguousLayout = YES;
to improve performance a bit.
, , .