summaryrefslogtreecommitdiff
path: root/cli/bench/main.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-04-05 18:31:07 +0530
committerGitHub <noreply@github.com>2023-04-05 18:31:07 +0530
commit34d596e04f49400ed6460e03461e21c441bcb5dd (patch)
treeda465892b423c0b47eb9c70a4869b7cb25383302 /cli/bench/main.rs
parentdb39855fcb9e90131432d1c03bd5c16263addb3e (diff)
chore(cli/bench): add ws echo bench (#18595)
Diffstat (limited to 'cli/bench/main.rs')
-rw-r--r--cli/bench/main.rs8
1 files changed, 8 insertions, 0 deletions
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<Value> {
let f = fs::File::open(filename)?;
@@ -401,6 +402,7 @@ struct BenchResult {
max_memory: HashMap<String, i64>,
lsp_exec_time: HashMap<String, i64>,
req_per_sec: HashMap<String, i64>,
+ ws_msg_per_sec: HashMap<String, f64>,
syscall_count: HashMap<String, i64>,
thread_count: HashMap<String, i64>,
}
@@ -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;