mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
perf(lsp): instrument all ops with performance marks (#21536)
Adds performance measurements for all ops used by the LSP. Also changes output of "Language server status" page to include more precise information. Current suspicion is that computing "script version" takes a long time for some users.
This commit is contained in:
parent
98121de5be
commit
88566cee72
4 changed files with 46 additions and 17 deletions
|
@ -3809,15 +3809,11 @@ impl Inner {
|
|||
.unwrap();
|
||||
contents
|
||||
.push_str("\n## Performance\n\n|Name|Duration|Count|\n|---|---|---|\n");
|
||||
let mut averages = self.performance.averages();
|
||||
averages.sort();
|
||||
for average in averages {
|
||||
writeln!(
|
||||
contents,
|
||||
"|{}|{}ms|{}|",
|
||||
average.name, average.average_duration, average.count
|
||||
)
|
||||
.unwrap();
|
||||
let mut averages = self.performance.averages_as_f64();
|
||||
averages.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
for (name, count, average_duration) in averages {
|
||||
writeln!(contents, "|{}|{}ms|{}|", name, average_duration, count)
|
||||
.unwrap();
|
||||
}
|
||||
Some(contents)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue