From 7890440d724b2088805db48df95ce9a531623d9b Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Fri, 1 Jul 2016 14:48:44 +0200 Subject: [PATCH] Switch to a faster Brotli crate --- components/net/Cargo.toml | 2 +- components/net/http_loader.rs | 2 +- components/servo/Cargo.lock | 14 +++++++++++--- ports/cef/Cargo.lock | 14 +++++++++++--- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml index 8ee59cfb98eb..2ee5e73bbba2 100644 --- a/components/net/Cargo.toml +++ b/components/net/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] bitflags = "0.7" -brotli = {git = "https://github.com/ende76/brotli-rs"} +brotli = "1.0.6" content-blocker = "0.2" cookie = { version = "0.2.5", features = ["serialize-serde", "serialize-rustc" ] } device = {git = "https://github.com/servo/devices"} diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 593ae3e1ead9..9112374cf98e 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -570,7 +570,7 @@ impl StreamedResponse { Decoder::Deflate(DeflateDecoder::new(response)) } Some(Encoding::EncodingExt(ref ext)) if ext == "br" => { - Decoder::Brotli(Decompressor::new(response)) + Decoder::Brotli(Decompressor::new(response, 1024)) } _ => { Decoder::Plain(response) diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index f97e69f73c9d..b8c14f0d465a 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -57,6 +57,11 @@ dependencies = [ "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "alloc-no-stdlib" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "android_glue" version = "0.1.3" @@ -184,8 +189,11 @@ dependencies = [ [[package]] name = "brotli" -version = "0.3.23" -source = "git+https://github.com/ende76/brotli-rs#d8507fd07e9fa57ed8251d5dc500dcd62df62c7c" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "browserhtml" @@ -1391,7 +1399,7 @@ name = "net" version = "0.0.1" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "brotli 0.3.23 (git+https://github.com/ende76/brotli-rs)", + "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "content-blocker 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "device 0.0.1 (git+https://github.com/servo/devices)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index b629fca21383..2c80c99ac2cb 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -31,6 +31,11 @@ dependencies = [ "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "alloc-no-stdlib" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "android_glue" version = "0.1.3" @@ -158,8 +163,11 @@ dependencies = [ [[package]] name = "brotli" -version = "0.3.23" -source = "git+https://github.com/ende76/brotli-rs#d8507fd07e9fa57ed8251d5dc500dcd62df62c7c" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "browserhtml" @@ -1293,7 +1301,7 @@ name = "net" version = "0.0.1" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "brotli 0.3.23 (git+https://github.com/ende76/brotli-rs)", + "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "content-blocker 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "device 0.0.1 (git+https://github.com/servo/devices)",