From d8036ab20c18572fdda26fa7398a152c734c62ed Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Tue, 24 Sep 2024 10:16:34 +0900 Subject: [PATCH] perf(ext/fetch): improve decompression throughput by upgrading `tower_http` (#25806) This commit improves the throughput when a Deno process is running as a proxy server that deals with compressed data from the upstream server. We have seen a performance degradation since v1.45.3 when we run a HTTP server with Deno with a particular setting, where it fetches _compressed_ data from the upstream server and forwards it to the end client. After some investigation, it turned out that [tower_http::decompression] causes this issue, which was fixed by the new version of this crate, v0.6.1. [tower_http::decompression]: https://docs.rs/tower-http/0.6.0/tower_http/decompression/index.html Fixes #25798 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d06b23bed1341a..30798cd8b968a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7541,9 +7541,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ "async-compression", "bitflags 2.6.0", @@ -7561,9 +7561,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" diff --git a/Cargo.toml b/Cargo.toml index f020812ad8e55a..81cbf8b4c6a449 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,7 +185,7 @@ tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring tokio-socks = "0.5.1" tokio-util = "0.7.4" tower = { version = "0.4.13", default-features = false, features = ["util"] } -tower-http = { version = "0.5.2", features = ["decompression-br", "decompression-gzip"] } +tower-http = { version = "0.6.1", features = ["decompression-br", "decompression-gzip"] } tower-lsp = { package = "deno_tower_lsp", version = "0.1.0", features = ["proposed"] } tower-service = "0.3.2" twox-hash = "=1.6.3"