From 8814ea82413f2bac3a3dc1f970cac83d588252d5 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sat, 7 Oct 2023 12:23:25 -0400 Subject: [PATCH] Time `compute_layout` --- crates/gpui3/src/taffy.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/gpui3/src/taffy.rs b/crates/gpui3/src/taffy.rs index 6e6af5685d..6edbd3593b 100644 --- a/crates/gpui3/src/taffy.rs +++ b/crates/gpui3/src/taffy.rs @@ -111,8 +111,8 @@ impl TaffyLayoutEngine { id: LayoutId, available_space: Size, ) -> Result<()> { - println!("Laying out {} children", self.count_all_children(id)?); - println!("Max layout depth: {}", self.max_depth(0, id)?); + // println!("Laying out {} children", self.count_all_children(id)?); + // println!("Max layout depth: {}", self.max_depth(0, id)?); // Output the edges (branches) of the tree in Mermaid format for visualization. // println!("Edges:"); @@ -121,8 +121,10 @@ impl TaffyLayoutEngine { // } // println!(""); + let started_at = std::time::Instant::now(); self.taffy .compute_layout(id.into(), available_space.into())?; + println!("compute_layout took {:?}", started_at.elapsed()); Ok(()) }