Skip to content

Commit 214d5eb

Browse files
committed
todo comment
1 parent ca10965 commit 214d5eb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Sources/TextDiff/AppKit/DiffTokenLayouter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ enum DiffTokenLayouter {
181181
}
182182

183183
lineText.append(text)
184+
// TODO: Fix this later
185+
// This now appends each token to lineText and calls size(withAttributes:) on the entire accumulated line every iteration, which makes layout cost grow quadratically with line length. On long unwrapped diffs (hundreds/thousands of tokens), this is a significant regression from the prior per-token measurement approach and can noticeably slow rendering even though the new performance tests only capture baselines and do not enforce thresholds.
184186
let combinedWidth = lineText.size(withAttributes: [.font: font]).width
185187
let textWidth = max(0, combinedWidth - lineTextWidth)
186188
return IncrementalTextWidth(

0 commit comments

Comments
 (0)