perf(editor): align benchmark with render skipping
This commit is contained in:
parent
be53eddfd2
commit
e4818c4cd7
1 changed files with 16 additions and 11 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue