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,7 +437,8 @@ public enum EditorBenchmarkProfiler {
)) ))
let clickRenderResult = measure { let clickRenderResult = measure {
MarkdownTextStyler.apply( if dirtyClickPlan.requiresStyling {
return MarkdownTextStyler.apply(
to: textStorage, to: textStorage,
invalidationPlan: dirtyClickPlan, invalidationPlan: dirtyClickPlan,
activeLineIndex: changedActiveLineIndex, activeLineIndex: changedActiveLineIndex,
@ -448,11 +449,15 @@ public enum EditorBenchmarkProfiler {
accentColor: .controlAccentColor 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 {