You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each TranscriptTextView makes its own LayoutEngine, with its own serial queue (LayoutEngine.swift:76) and image store. Each view also makes a text interaction and draws into tiles. This is fine for a few long answers. A list of cards can show hundreds of short texts, and the cost in that case is not known. The benchmark measures long documents only.
Proposal
Add a benchmark: a scrolling LazyVStack of 200 cards, each with two or three texts of one to three lines. Measure dropped frames, memory and the time to the first layout.
Share one layout queue, or a small pool of queues, between views.
Create the text interaction, the tiles and the image store only when a view needs them.
Status, checked on an iPhone 12 mini with main at 1afd010:
The cost is now measured. A local version of the proposed benchmark scrolls 200 cards, each with three short Markdown texts, at 3,000 points a second for 10 s. Median of three runs:
SwiftUI Text
TranscriptText
Dropped frames
0
0
Main-thread CPU
3.48 s
3.95 s
Memory peak
24 MB
39 MB
The benchmark is not in the repository yet.
Partly done: create things only when a view needs them.
Each view still has its own layout queue (LayoutEngine.swift:79) and its own image store.
A selectable view creates its text interaction at once.
No frames drop, and the main thread does about 13% more work than with Text. So the rest of this issue is an optimization, not a problem that users see.
Activity
servercimen commentedon Nov 20, 2026
Status, checked on an iPhone 12 mini with
mainat 1afd010:The cost is now measured. A local version of the proposed benchmark scrolls 200 cards, each with three short Markdown texts, at 3,000 points a second for 10 s. Median of three runs:
TextTranscriptTextThe benchmark is not in the repository yet.
Partly done: create things only when a view needs them.
Not done:
No frames drop, and the main thread does about 13% more work than with
Text. So the rest of this issue is an optimization, not a problem that users see.Set up text selection on demand, and draw rows that a lazy stack moves (