After #189 made styling linear, typing p95 in the middle of a large file is unchanged: about 12, 23 and 44 ms at 1, 2 and 4 MB, and 110 ms at 10 MB. Restyling one paragraph in the middle of the 10 MB file takes 3.9 ms, so the cost is elsewhere in OrgEditor.storageEdited.
Candidates that scale with file size: the per-edit mapping of every wrapper fold and shaded block, view.mapped(...).pruned(to:), and updateHidden. Profile and fix. Decide also whether 10 MB is a supported file size.
Related, found in the same work:
refreshImagesrestyles the whole file synchronously (onbaseDirectoryset with images showing, image or LaTeX toggles, and width changes).- In plain (non-org) mode
restyleapplies highlighter runs for the whole file, not in one pass. - With a proportional body font, the fixed-pitch prefix pass starts again from the beginning of each chunk.
Platforms: Mac.