mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 23:54:37 +00:00
fix(test_util): make hyper server single-threaded (#8951)
Use Tokio's single-threaded scheduler. The hyper server is used as a point of comparison for the (single-threaded!) benchmarks in cli/bench. We're not comparing apples to apples if we use the default multi-threaded scheduler. This drops the requests/sec from 284k to 130k on my 12 core Ryzen 5 system. That still leaves a 50k gap for us to close. Working on it!
This commit is contained in:
parent
012f99bd9a
commit
88855b5d95
1 changed files with 4 additions and 1 deletions
|
@ -722,7 +722,10 @@ async fn wrap_main_https_server() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
// Use the single-threaded scheduler. The hyper server is used as a point of
|
||||||
|
// comparison for the (single-threaded!) benchmarks in cli/bench. We're not
|
||||||
|
// comparing apples to apples if we use the default multi-threaded scheduler.
|
||||||
|
#[tokio::main(basic_scheduler)]
|
||||||
pub async fn run_all_servers() {
|
pub async fn run_all_servers() {
|
||||||
if let Some(port) = env::args().nth(1) {
|
if let Some(port) = env::args().nth(1) {
|
||||||
return hyper_hello(port.parse::<u16>().unwrap()).await;
|
return hyper_hello(port.parse::<u16>().unwrap()).await;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue