perf(bench): report tracked editor interaction metrics
This commit is contained in:
parent
a29844dfbc
commit
525691693b
1 changed files with 18 additions and 0 deletions
|
|
@ -86,10 +86,28 @@ func printScenario(name: String, result: EditorBenchmarkResult) {
|
|||
+ "\(format(measurement.durationMilliseconds)) ms | \(format(percentage))% | \(measurement.notes) |")
|
||||
}
|
||||
print("")
|
||||
print("Tracked interaction metrics:")
|
||||
print("")
|
||||
print("| Operation | Time | Notes |")
|
||||
print("| --- | ---: | --- |")
|
||||
for name in trackedInteractionMetricNames {
|
||||
guard let measurement = result.measurements.first(where: { $0.name == name }) else { continue }
|
||||
print("| `\(measurement.name)` | \(format(measurement.durationMilliseconds)) ms | \(measurement.notes) |")
|
||||
}
|
||||
print("")
|
||||
print("Measured total: \(format(result.measuredTotalMilliseconds)) ms")
|
||||
print("")
|
||||
}
|
||||
|
||||
let trackedInteractionMetricNames = [
|
||||
"active_line_lookup",
|
||||
"selection_update",
|
||||
"dirty_line_invalidation_click",
|
||||
"typing_state_update",
|
||||
"dirty_line_invalidation_typing",
|
||||
"render_update_typing_dirty"
|
||||
]
|
||||
|
||||
func format(_ value: Double) -> String {
|
||||
String(format: "%.3f", value)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue