CoreText original renderer + Realm database to render long text fast and efficiently.
Text with 3 million characters start up instantly.
Fast text search thanks to Realm.
Base memory usage is about 15-20MB.
Try different font by importing your otf or ttf font in your iCloud Drive. CoreData version has also been developed. The similar performance was achieved.
The project consists of 10,000 lines of Objective-C renderer and 6,000 lines of Swift 3 codes for user interface.