Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

perf(desktop-gpui): let the hover bench yield between overloaded moves

Scott Newton094120cae78a
diff --git a/apps/desktop-gpui/src/editor_hover_bench.rs b/apps/desktop-gpui/src/editor_hover_bench.rs
index 2a0a2747b..4325410ad 100644
--- a/apps/desktop-gpui/src/editor_hover_bench.rs
+++ b/apps/desktop-gpui/src/editor_hover_bench.rs
@@ -64,6 +64,9 @@ pub async fn run(handle: WindowHandle<EditorWindow>, cx: &mut gpui::AsyncApp) {
.await;
} else {
next_move = now;
+ // An overloaded loop must still give the preview pump and the run
+ // loop a turn between moves, as real event dispatch does.
+ tokio::task::yield_now().await;
}
let elapsed = started.elapsed();
if elapsed >= WARMUP + MEASURED {