In a Swing application, I sometimes need to support read-only access to large, line-oriented text files that are slow to load: logs, dumps, traces, etc. For small amounts of
I would separate the problem.
The first one is model - Document building speed
The second is the Document rendering - building tree of views to represent the Document.
A question is whether you need font effects like keywords colorizing?
I would start from Document building part. IMHO reading the file via EditorKit.read() should be fast even for big files. I would use the PainDocument for the purpose and check whether the pure model is built fast enough for your application. If yes it's fine just use the Document as model. If not implement your own Document interface because AbstractDocument has plenty of methods for update processing (e.g. writeLock).
When we have the Document loading fast enough we have to solve the Document rendering. BY default the views used in javax.swing.text are really flexible. They are designed as base classes to be extended - thus has a lot of code we don't need. E.g. measuring.
For the feature I would use Monospaced font, we don't need wrap so measurements of the view widht is fast = longest row char count * char widht.
The height is also char height * amount of lines.
So our PLainTextViewReplacement is really fast. Also we don't have to render the whole view but just a fragment visible in our scroll pane. Thus rendering could be mmuch much faster.
Of course there should be a lot of work to provide correct caret navigation, selection etc.