perf(editor): align benchmark with render skipping

This commit is contained in:
Feror 2026-05-30 17:59:41 +02:00
parent be53eddfd2
commit e4818c4cd7

View file

@ -437,22 +437,27 @@ public enum EditorBenchmarkProfiler {
)) ))
let clickRenderResult = measure { let clickRenderResult = measure {
MarkdownTextStyler.apply( if dirtyClickPlan.requiresStyling {
to: textStorage, return MarkdownTextStyler.apply(
invalidationPlan: dirtyClickPlan, to: textStorage,
activeLineIndex: changedActiveLineIndex, invalidationPlan: dirtyClickPlan,
backgroundColor: .textBackgroundColor, activeLineIndex: changedActiveLineIndex,
activeLineBackgroundColor: .controlAccentColor.withAlphaComponent(0.10), backgroundColor: .textBackgroundColor,
textColor: .labelColor, activeLineBackgroundColor: .controlAccentColor.withAlphaComponent(0.10),
secondaryTextColor: .secondaryLabelColor, textColor: .labelColor,
accentColor: .controlAccentColor secondaryTextColor: .secondaryLabelColor,
) accentColor: .controlAccentColor
)
}
return MarkdownTextStylingResult.empty
} }
measurements.append(EditorBenchmarkMeasurement( measurements.append(EditorBenchmarkMeasurement(
name: "render_update_click_dirty", name: "render_update_click_dirty",
category: .interaction, category: .interaction,
durationMilliseconds: clickRenderResult.durationMilliseconds, durationMilliseconds: clickRenderResult.durationMilliseconds,
notes: "\(clickRenderResult.value.styledLineCount) styled lines" notes: dirtyClickPlan.requiresStyling
? "\(clickRenderResult.value.styledLineCount) styled lines"
: "skipped; dirty plan did not require styling"
)) ))
let typingStorageResult = measure { let typingStorageResult = measure {