[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.
This commit is contained in:
Andrew Gallant 2025-08-21 12:35:05 -04:00 committed by Andrew Gallant
parent 85931ab594
commit 06dbec8479

View file

@ -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 {