Severity: High.
BacklinksPane is shown by default (Sources/Orgstar/ContentView.swift:95-97) and its .task(id:) includes session.editVersion (Sources/Orgstar/BacklinksPane.swift:35), so refresh() (:59-77) runs synchronously on the main actor after each 300 ms typing pause and each caret move to another heading. It tests every link in the index with Backlinks.links (Sources/OrgApp/WorkspaceModel.swift:445-456); 75 % of the time is a regex literal re-parsed per link (Sources/OrgCore/Links/Backlinks.swift:45) and 10 % an NSRegularExpression built per call (Sources/OrgCore/Links/Links.swift:38). Measured in the release app with 49,400 links: 1.6 s to 9.8 s blocked at launch and after each pause; about 0.3 s per 5,000 links. Hoist the regexes to statics, compute off the main actor, and recompute only when the file, heading or index changes.
From the performance review, docs/review-2026-11-21.md (#96).
Platforms: macOS; iOS uses the same functions when the Backlinks screen opens (Sources/OrgstarMobile/BacklinksScreen.swift:59-63).
closed by cmc in commit 9e9d587ae8: Compute backlinks off the main actor, when the file, heading or index changes
2026-11-22 12:37 UTC