mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
[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:
parent
85931ab594
commit
06dbec8479
1 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue