summaryrefslogtreecommitdiff
path: root/cli/bench/lsp.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-06-28 17:51:05 +0530
committerGitHub <noreply@github.com>2022-06-28 17:51:05 +0530
commitab11b45d1d2678cfea2217ac72fc24317eef777d (patch)
tree055861eb84d34a32268efc722f39f81022f5e9b3 /cli/bench/lsp.rs
parent00f4521b205bf25c79f0fa7c9a6840941342bda4 (diff)
refactor(bench): continuous benchmarking improvements (#14821)
Diffstat (limited to 'cli/bench/lsp.rs')
-rw-r--r--cli/bench/lsp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/bench/lsp.rs b/cli/bench/lsp.rs
index 8397d23d7..7aa35d099 100644
--- a/cli/bench/lsp.rs
+++ b/cli/bench/lsp.rs
@@ -333,7 +333,7 @@ fn bench_startup_shutdown(deno_exe: &Path) -> Result<Duration, AnyError> {
}
/// Generate benchmarks for the LSP server.
-pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, u64>, AnyError> {
+pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, i64>, AnyError> {
println!("-> Start benchmarking lsp");
let mut exec_times = HashMap::new();
@@ -343,7 +343,7 @@ pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, u64>, AnyError> {
times.push(bench_startup_shutdown(deno_exe)?);
}
let mean =
- (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as u64;
+ (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as i64;
println!(" ({} runs, mean: {}ms)", times.len(), mean);
exec_times.insert("startup_shutdown".to_string(), mean);
@@ -353,7 +353,7 @@ pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, u64>, AnyError> {
times.push(bench_big_file_edits(deno_exe)?);
}
let mean =
- (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as u64;
+ (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as i64;
println!(" ({} runs, mean: {}ms)", times.len(), mean);
exec_times.insert("big_file_edits".to_string(), mean);
@@ -363,7 +363,7 @@ pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, u64>, AnyError> {
times.push(bench_find_replace(deno_exe)?);
}
let mean =
- (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as u64;
+ (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as i64;
println!(" ({} runs, mean: {}ms)", times.len(), mean);
exec_times.insert("find_replace".to_string(), mean);
@@ -373,7 +373,7 @@ pub fn benchmarks(deno_exe: &Path) -> Result<HashMap<String, u64>, AnyError> {
times.push(bench_code_lens(deno_exe)?);
}
let mean =
- (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as u64;
+ (times.iter().sum::<Duration>() / times.len() as u32).as_millis() as i64;
println!(" ({} runs, mean: {}ms)", times.len(), mean);
exec_times.insert("code_lens".to_string(), mean);