From 34d596e04f49400ed6460e03461e21c441bcb5dd Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 5 Apr 2023 18:31:07 +0530 Subject: chore(cli/bench): add ws echo bench (#18595) --- cli/bench/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli/bench/main.rs') diff --git a/cli/bench/main.rs b/cli/bench/main.rs index 48598a9b0..721cf06ab 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -17,6 +17,7 @@ include!("../util/time.rs"); mod http; mod lsp; +mod websocket; fn read_json(filename: &str) -> Result { let f = fs::File::open(filename)?; @@ -401,6 +402,7 @@ struct BenchResult { max_memory: HashMap, lsp_exec_time: HashMap, req_per_sec: HashMap, + ws_msg_per_sec: HashMap, syscall_count: HashMap, thread_count: HashMap, } @@ -416,6 +418,7 @@ async fn main() -> Result<()> { "cargo_deps", "lsp", "http", + "websocket", "strace", "mem_usage", ]; @@ -455,6 +458,11 @@ async fn main() -> Result<()> { ..Default::default() }; + if benchmarks.contains(&"websocket") { + let ws = websocket::benchmark()?; + new_data.ws_msg_per_sec = ws; + } + if benchmarks.contains(&"bundle") { let bundle_size = bundle_benchmark(&deno_exe)?; new_data.bundle_size = bundle_size; -- cgit v1.2.3