[museion-OPT-F1/F2] With a fold open, every keystroke re-attributes and re-rasterizes the whole document — scope to the edited paragraph/viewport #142

Closed
opened 2026-11-02 23:09:24 +01:00 by AlexKucera · 0 comments
Owner

Effort M · ticket-now (Alexander's cycle-1 verdict, 2026-11-02).

Evidence (~/argus-audits/audit/2026-11-02/museion-opt.md, F1 High + F2 High):

  • F1: Museion/ProseListTextView.swift:165-206 (refreshFolds → refreshFoldRendering), driven per keystroke from Museion/PostEditorView.swift:518. With ONE fold live, the cheap chrome-only path (:166-169) is skipped: full-buffer ProseList.parents(in:) scan + full-document NSMutableAttributedString rebuild (ProsePresenter.attribute) + setAttributedString invalidating TextKit layout for the ENTIRE document, per keystroke → O(n²) typing on folded documents.
  • F2: ProseListTextView.swift:42-56, :239-259 — the chrome overlay rasters an NSImage the size of the FULL document per keystroke (~35M pixels for a 700×50,000pt doc) plus 2–3 further full-buffer scans; the code's own comment at :47-48 concedes it.

Fix direction: paragraph-scoped fold re-keying on text edits (full refresh reserved for structural edits and generation loads); viewport-clipped chrome raster or per-parent chevron sublayers; compute parents once per edit and hand it around. Full report: ~/argus-audits/audit/2026-11-02/museion-opt.md
[Generated by AI]

Effort M · ticket-now (Alexander's cycle-1 verdict, 2026-11-02). Evidence (~/argus-audits/audit/2026-11-02/museion-opt.md, F1 High + F2 High): - F1: `Museion/ProseListTextView.swift:165-206` (`refreshFolds` → `refreshFoldRendering`), driven per keystroke from `Museion/PostEditorView.swift:518`. With ONE fold live, the cheap chrome-only path (`:166-169`) is skipped: full-buffer `ProseList.parents(in:)` scan + full-document `NSMutableAttributedString` rebuild (`ProsePresenter.attribute`) + `setAttributedString` invalidating TextKit layout for the ENTIRE document, per keystroke → O(n²) typing on folded documents. - F2: `ProseListTextView.swift:42-56`, `:239-259` — the chrome overlay rasters an `NSImage` the size of the FULL document per keystroke (~35M pixels for a 700×50,000pt doc) plus 2–3 further full-buffer scans; the code's own comment at `:47-48` concedes it. Fix direction: paragraph-scoped fold re-keying on text edits (full refresh reserved for structural edits and generation loads); viewport-clipped chrome raster or per-parent chevron sublayers; compute `parents` once per edit and hand it around. Full report: ~/argus-audits/audit/2026-11-02/museion-opt.md [Generated by AI]
Sign in to join this conversation.