From 06dbec84796c6eaac43ba1bb2063fbe006574989 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 21 Aug 2025 12:35:05 -0400 Subject: [PATCH] [ty] Add debug trace for workspace symbol elapsed time Useful for ad hoc debugging, but it's also useful to have permanently to enable serendipitous discovery of performance problems. --- .../ty_server/src/server/api/requests/workspace_symbols.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ty_server/src/server/api/requests/workspace_symbols.rs b/crates/ty_server/src/server/api/requests/workspace_symbols.rs index e6b170a264..a964954546 100644 --- a/crates/ty_server/src/server/api/requests/workspace_symbols.rs +++ b/crates/ty_server/src/server/api/requests/workspace_symbols.rs @@ -29,7 +29,13 @@ impl BackgroundRequestHandler for WorkspaceSymbolRequestHandler { // Iterate through all projects in the session for db in snapshot.projects() { // Get workspace symbols matching the query + let start = std::time::Instant::now(); let workspace_symbol_infos = workspace_symbols(db, query); + tracing::debug!( + "Found {len} workspace symbols in {elapsed:?}", + len = workspace_symbol_infos.len(), + elapsed = std::time::Instant::now().duration_since(start) + ); // Convert to LSP SymbolInformation for workspace_symbol_info in workspace_symbol_infos {